diff --git a/.npmignore b/.npmignore index 300fd7e..a3cb5c2 100644 --- a/.npmignore +++ b/.npmignore @@ -4,7 +4,6 @@ node_modules/ npm-debug.log -lib/ test/ .travis.yml diff --git a/.travis.yml b/.travis.yml index 29c15b5..3592d72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/lib/index.js b/lib/index.js index 203ff0c..bc825ef 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,20 +1,20 @@ -import loaderUtils from 'loader-utils' +var loaderUtils = require('loader-utils') -const domModuleRegex = // +var domModuleRegex = // 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))) } diff --git a/package.json b/package.json index 001bdc2..4d49ec6 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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": { diff --git a/rollup.config.js b/rollup.config.js deleted file mode 100644 index c9284ce..0000000 --- a/rollup.config.js +++ /dev/null @@ -1,35 +0,0 @@ -const rollup = require('rollup') -const buble = require('rollup-plugin-buble') -const eslint = require('rollup-plugin-eslint') -const globals = require('rollup-plugin-node-globals') - -const pkg = require('./package.json') -const external = Object.keys(pkg.dependencies) - -let cache - -rollup.rollup({ - entry: 'lib/index.js', - cache: cache, - external: external, - plugins: [ - eslint(), - buble(), - globals() - ] -}).then(bundle => { - // cache bundle - cache = bundle - bundle.write({ - format: 'cjs', - exports: 'named', - dest: pkg['main'] - }) - - if (process.env.NODE_ENV === 'production') { - bundle.write({ - dest: pkg['jsnext:main'], - format: 'es' - }) - } -})