Browserify transform for Svelte
Switch branches/tags
Nothing to show
Clone or download
Latest commit 675bea5 Apr 23, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test Svelte 2 compatibility Apr 23, 2018
.gitignore Make it so Dec 1, 2016
.npmignore Make it so Dec 1, 2016
index.js Svelte 2 compatibility Apr 23, 2018
package-lock.json 2.0.0 Apr 23, 2018
package.json 2.0.0 Apr 23, 2018
readme.md Noting the relationship between svelte/sveltify versions Apr 23, 2018

readme.md

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@2, you need sveltify@2, 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