/sveltify

Browserify transform for Svelte

Primary LanguageJavaScript

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.

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