Svelte plugin for Metalsmith
npm install --save-dev metalsmith-svelte
Add the metalsmith-svelte field to your metalsmith.json.
{
"plugins": {
"metalsmith-svelte": {
"name": "MyComponent",
"sourceMap": "inline"
}
}
}const Metalsmith = require('metalsmith');
const svelte = require('metalsmith-svelte');
new Metalsmith('./source')
.use(svelte({
sourceMap: true
}))
.build((err, files) => {
if (err) {
throw err;
}
console.log('Completed.');
});Svelte compiler options are available except for:
filenameoption is not supported and will be automatically set.onerroroption is not supported as there is no value to use it.
In addition the following option is supported:
Value: true, false or 'inline'
Default: false
truegenerates a separate source map file with.mapextension, for exmapleindex.js.mapalong withindex.js.'inline'appends an inline source map to the transformed file.
ISC License © 2017 - 2018 Shinnosuke Watanabe