0.3.0 • Published 7 years ago
metalsmith-svelte v0.3.0
metalsmith-svelte
Svelte plugin for Metalsmith
Installation
npm install metalsmith-svelteUsage
CLI
Add the metalsmith-svelte field to your metalsmith.json.
{
"plugins": {
"metalsmith-svelte": {
"name": 'MyComponent',
"sourceMap": "inline"
}
}
}API
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.');
});Options
All Svelte compiler options are available except for filename that will be automatically set.
In addition the following option is supported:
options.sourceMap
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.
License
ISC License © 2017 Shinnosuke Watanabe