A Browserify transform allowing you to require Svelte templates.
Defaults to transforming all .html
and .svelte
files. You can overwrite the transformed extensions with the extensions
argument.
If you're using svelte@3
, you need sveltify@3
, and vice versa.
browserify -t [ sveltify --extensions [.htmlz .svelte] ] myfile.js
{
"browserify": {
"transform": [
[
"sveltify",
{
"extensions": [
".html",
".svelte"
]
}
]
]
}
}
Pass options to the Svelte compiler with the svelte
property:
browserify -t [ sveltify --svelte [ --dev=true ] ] myfile.js
{
"browserify": {
"transform": [
[
"sveltify",
{
"svelte": {
"dev": true
}
}
]
]
}
}