Skip to content

Commit

Permalink
Add support of Neutrino 8
Browse files Browse the repository at this point in the history
  • Loading branch information
constgen committed Jan 21, 2018
1 parent ee57416 commit f3452c3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ jspm_packages

# Optional REPL history
.node_repl_history

.vscode
18 changes: 12 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
}))
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -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 <const.gen@gmail.com>",
Expand All @@ -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",
Expand Down

0 comments on commit f3452c3

Please sign in to comment.