rollup-plugin-svelte
Advanced tools
Comparing version 1.6.1 to 1.7.0
# rollup-plugin-svelte changelog | ||
## 1.7.0 | ||
* Pass all options through to Svelte (e.g. `dev`) | ||
## 1.6.1 | ||
@@ -4,0 +8,0 @@ |
@@ -20,2 +20,8 @@ 'use strict'; | ||
var pluginOptions = { | ||
include: true, | ||
exclude: true, | ||
extensions: true | ||
}; | ||
function svelte$1 ( options ) { | ||
@@ -28,2 +34,22 @@ if ( options === void 0 ) options = {}; | ||
var fixedOptions = {}; | ||
Object.keys( options ).forEach( function (key) { | ||
// add all options except include, exclude, extensions | ||
if ( pluginOptions[ key ] ) { return; } | ||
fixedOptions[ key ] = options[ key ]; | ||
}); | ||
fixedOptions.format = 'es'; | ||
fixedOptions.shared = require.resolve( 'svelte/shared.js' ); | ||
fixedOptions.onerror = function (err) { | ||
var message = ( err.loc ? ("(" + (err.loc.line) + ":" + (err.loc.column) + ") ") : '' ) + err.message; | ||
if ( err.frame ) { message += "\n" + (err.frame); } | ||
var err2 = new Error( message ); | ||
err2.stack = err.stack; | ||
throw err2; | ||
}; | ||
return { | ||
@@ -36,22 +62,6 @@ name: 'svelte', | ||
var name = capitalize( sanitize( id ) ); | ||
return svelte.compile( code, { | ||
name: name, | ||
filename: id, | ||
css: options.css, | ||
generate: options.generate, | ||
format: 'es', | ||
shared: require.resolve( 'svelte/shared.js' ), | ||
onerror: function onerror ( err ) { | ||
var message = ( err.loc ? ("(" + (err.loc.line) + ":" + (err.loc.column) + ") ") : '' ) + err.message; | ||
if ( err.frame ) { message += "\n" + (err.frame); } | ||
var err2 = new Error( message ); | ||
err2.stack = err.stack; | ||
throw err2; | ||
} | ||
}); | ||
return svelte.compile( code, Object.assign( {}, fixedOptions, { | ||
name: capitalize( sanitize( id ) ), | ||
filename: id | ||
})); | ||
} | ||
@@ -58,0 +68,0 @@ }; |
@@ -18,2 +18,8 @@ import { basename, extname } from 'path'; | ||
var pluginOptions = { | ||
include: true, | ||
exclude: true, | ||
extensions: true | ||
}; | ||
function svelte$1 ( options ) { | ||
@@ -26,2 +32,22 @@ if ( options === void 0 ) options = {}; | ||
var fixedOptions = {}; | ||
Object.keys( options ).forEach( function (key) { | ||
// add all options except include, exclude, extensions | ||
if ( pluginOptions[ key ] ) { return; } | ||
fixedOptions[ key ] = options[ key ]; | ||
}); | ||
fixedOptions.format = 'es'; | ||
fixedOptions.shared = require.resolve( 'svelte/shared.js' ); | ||
fixedOptions.onerror = function (err) { | ||
var message = ( err.loc ? ("(" + (err.loc.line) + ":" + (err.loc.column) + ") ") : '' ) + err.message; | ||
if ( err.frame ) { message += "\n" + (err.frame); } | ||
var err2 = new Error( message ); | ||
err2.stack = err.stack; | ||
throw err2; | ||
}; | ||
return { | ||
@@ -34,22 +60,6 @@ name: 'svelte', | ||
var name = capitalize( sanitize( id ) ); | ||
return compile( code, { | ||
name: name, | ||
filename: id, | ||
css: options.css, | ||
generate: options.generate, | ||
format: 'es', | ||
shared: require.resolve( 'svelte/shared.js' ), | ||
onerror: function onerror ( err ) { | ||
var message = ( err.loc ? ("(" + (err.loc.line) + ":" + (err.loc.column) + ") ") : '' ) + err.message; | ||
if ( err.frame ) { message += "\n" + (err.frame); } | ||
var err2 = new Error( message ); | ||
err2.stack = err.stack; | ||
throw err2; | ||
} | ||
}); | ||
return compile( code, Object.assign( {}, fixedOptions, { | ||
name: capitalize( sanitize( id ) ), | ||
filename: id | ||
})); | ||
} | ||
@@ -56,0 +66,0 @@ }; |
{ | ||
"name": "rollup-plugin-svelte", | ||
"version": "1.6.1", | ||
"version": "1.7.0", | ||
"description": "Compile Svelte components with Rollup", | ||
@@ -5,0 +5,0 @@ "main": "dist/rollup-plugin-svelte.cjs.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6956
103