Skip to content

Commit

Permalink
Loaders options are merged but not overrided
Browse files Browse the repository at this point in the history
  • Loading branch information
constgen committed Jul 26, 2017
1 parent dee0386 commit e379727
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

let path = require('path')
let arrify = require('arrify')
let merge = require('deepmerge')

module.exports = function (neutrino, options = {}) {
const NODE_MODULES = path.join(__dirname, 'node_modules')
Expand Down Expand Up @@ -39,25 +40,27 @@ module.exports = function (neutrino, options = {}) {
.end()
.use('svelte')
.loader(require.resolve('svelte-loader'))
.options({
.tap((opts = {}) => merge({
format: 'es',
generate: 'dom', //ssr
name: 'SvelteComponent',
// filename: 'SvelteComponent.html',
// shared: true,
// sourcemap disabling is not implemented in Svelte Compiler
dev: true,
css: true
})
}, opts))
.tap((opts = {}) => merge(opts, options))
.end()
.use('extract-html')
.loader(require.resolve('extract-loader'))
.end()
.use('html')
.loader(require.resolve('html-loader'))
.options({
.tap((opts = {}) => merge({
attrs: ['img:src', 'script:src', 'link:href', 'source:src', 'source:srcset'],
minimize: false
})
}, opts))
.end()
)

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neutrino-middleware-svelte-loader",
"version": "3.0.0",
"version": "3.1.0",
"description": "Neutrino Svelte loader middleware",
"main": "index.js",
"author": "Constantine Genchevsky <const.gen@gmail.com>",
Expand All @@ -12,8 +12,8 @@
"homepage": "https://github.com/constgen/neutrino-middleware-svelte-loader",
"keywords": [
"neutrino",
"neutrino-preset",
"neutrino-middlware",
"neutrino middlware",
"webpack",
"svelte"
],
Expand Down

0 comments on commit e379727

Please sign in to comment.