diff --git a/.gitignore b/.gitignore index 5148e52..7c3b9d6 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,5 @@ jspm_packages # Optional REPL history .node_repl_history + +.vscode diff --git a/index.js b/index.js index 330a262..4f4ba1f 100644 --- a/index.js +++ b/index.js @@ -4,12 +4,12 @@ let path = require('path') let arrify = require('arrify') let deepmerge = require('deepmerge') -function merge(options = {}){ +function mergeWith(options = {}){ return function(opts = {}){ return deepmerge(opts, options) } } -function premerge(options = {}){ +function mergeTo(options = {}){ return function(opts = {}){ return deepmerge(options, opts) } @@ -50,24 +50,30 @@ module.exports = function (neutrino, options = {}) { .end() .use('svelte') .loader(require.resolve('svelte-loader')) - .tap(premerge({ + .tap(mergeTo({ format: 'es', - generate: 'dom', //ssr + generate: 'dom', //or 'ssr' name: 'SvelteComponent', // filename: 'SvelteComponent.html', // shared: true, // sourcemap disabling is not implemented in Svelte Compiler dev: (process.env.NODE_ENV === 'development'), css: true + // emitCss: false + // preprocess: { + // markup + // style + // script + // } })) - .tap(merge(options)) + .tap(mergeWith(options)) .end() .use('extract-html') .loader(require.resolve('extract-loader')) .end() .use('html') .loader(require.resolve('html-loader')) - .tap(premerge({ + .tap(mergeTo({ attrs: [':url', 'img:src', 'script:src', 'link:href', 'source:src', 'source:srcset'], minimize: false })) diff --git a/package.json b/package.json index cdd1470..c26c2c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "neutrino-middleware-svelte-loader", - "version": "4.0.0", + "version": "4.1.0", "description": "Neutrino Svelte loader middleware", "main": "index.js", "author": "Constantine Genchevsky ", @@ -18,18 +18,18 @@ "svelte" ], "dependencies": { - "deepmerge": "~2.0.0", + "deepmerge": "~2.0.1", "arrify": "~1.0.1", - "svelte-loader": "~2.1.0", - "extract-loader": "~1.0.1", - "html-loader": "~0.5.1" + "svelte-loader": "~2.3.3", + "extract-loader": "~1.0.2", + "html-loader": "~0.5.5" }, "devDependencies": { "svelte": "^1.0.7", - "eslint": "~3.19.0" + "eslint": "~4.16.0" }, "peerDependencies": { - "neutrino": "^5.0.0 || ^6.0.0 || ^7.0.0" + "neutrino": ">=5.x.x <=8.x.x" }, "files": [ "*.js",