Skip to content

Commit

Permalink
feat: remove es
Browse files Browse the repository at this point in the history
  • Loading branch information
vagusX committed Mar 27, 2017
1 parent f7fbfc2 commit 2a4e239
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 61 deletions.
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
node_modules/
npm-debug.log

lib/
test/

.travis.yml
Expand Down
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ notifications:
email: false
node_js:
- '6'
- '7'
before_install:
- npm i -g npm@^3.0.0
before_script:
- npm prune
script:
- npm run build
after_success:
- npm run test
- npm run semantic-release
branches:
only:
Expand Down
14 changes: 7 additions & 7 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import loaderUtils from 'loader-utils'
var loaderUtils = require('loader-utils')

const domModuleRegex = /<dom-module.*?id=["'](.*?)["'].*?>/
var domModuleRegex = /<dom-module.*?id=["'](.*?)["'].*?>/

module.exports = function (content) {
this.cacheable && this.cacheable()

const url = loaderUtils.interpolateName(this, '[path][name].[ext]', {
var url = loaderUtils.interpolateName(this, '[path][name].[ext]', {
context: this.options.context
})

const meta = { url }
const result = content.match(domModuleRegex)
var meta = { url: url }
var result = content.match(domModuleRegex)

if (Array.isArray(result) && result[1]) {
meta.name = result[1]
meta.tagName = result[1]
}

return `module.exports = ${JSON.stringify(meta)}`
return ('module.exports = ' + (JSON.stringify(meta)))
}
17 changes: 2 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
{
"name": "html-imports-loader",
"description": "",
"main": "dist/html-imports-loader.js",
"jsnext:main": "dist/html-imports-loader.es2015.js",
"main": "lib/index.js",
"scripts": {
"build": "rimraf dist/** && NODE_ENV=production node rollup.config.js",
"build:dev": "node rollup.config.js",
"dev": "npm run build:dev && npm run watch",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"watch": "onchange lib -- npm run dev"
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"repository": {
"type": "git",
Expand All @@ -27,14 +22,6 @@
"homepage": "https://github.com/vagusX/html-imports-loader#readme",
"devDependencies": {
"ghooks": "^2.0.0",
"onchange": "^3.2.1",
"rimraf": "^2.6.1",
"rollup": "^0.41.6",
"rollup-plugin-buble": "^0.15.0",
"rollup-plugin-eslint": "^3.0.0",
"rollup-plugin-node-globals": "^1.1.0",
"semantic-release": "^6.3.2",
"standard": "^9.0.2",
"validate-commit-message": "^3.0.1"
},
"dependencies": {
Expand Down
35 changes: 0 additions & 35 deletions rollup.config.js

This file was deleted.

0 comments on commit 2a4e239

Please sign in to comment.