sveltify Svelte Themes

Sveltify

Browserify transform for Svelte

sveltify

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.

Usage

browserify -t [ sveltify --extensions [.htmlz .svelte] ] myfile.js
{
  "browserify": {
    "transform": [
      [
        "sveltify",
        {
          "extensions": [
            ".html",
            ".svelte"
          ]
        }
      ]
    ]
  }
}

Svelte Options

Pass options to the Svelte compiler with the svelte property:

browserify -t [ sveltify --svelte [ --dev=true ] ] myfile.js
{
  "browserify": {
    "transform": [
      [
        "sveltify",
        {
          "svelte": {
            "dev": true
          }
        }
      ]
    ]
  }
}

License

WTFPL

Top categories

Loading Svelte Themes