5.0.0 • Published 5 years ago

neutrino-middleware-svelte-loader v5.0.0

Weekly downloads
4
License
GPL-3.0
Repository
github
Last release
5 years ago

Neutrino Svelte loader middleware

npm npm

neutrino-middleware-svelte-loader is a Neutrino middleware for compiling HTML components with Svelte. It is compatible with .html, .htm and .svelte files.

Requirements

  • Node.js v6.9+
  • Neutrino v5+
  • Svelte v1.44.0+

Installation

neutrino-middleware-svelte-loader can be installed from NPM.

❯ npm install --save neutrino-middleware-svelte-loader

Usage

neutrino-middleware-svelte-loader can be consumed from the Neutrino API, middleware, or presets. Require this package and plug it into Neutrino:

const svelteLoader = require('neutrino-middleware-svelte-loader')

neutrino.use(svelteLoader, {
  include: [],
  exclude: [],
  svelte: { emitCss: true }
})
  • include: optional array of paths to include in the compilation. Maps to Webpack's rule.include.
  • exclude: optional array of paths to exclude from the compilation. Maps to Webpack's rule.include.
  • svelte: optional object to pass to svelte-loader options.

It is recommended to call this middleware after the neutrino.config.module.rule('compile') initialization to avoid unexpected overriding and to support transpilation of Svelte components. More information about usage of Neutrino middlewares can be found in the documentation.

Rules

This is a list of rules that are used by neutrino-middleware-svelte-loader:

  • svelte: Compiles Svelte components to JavaScript modules. Contains a single loader named the same svelte.
  • html: Compiles Svelte components to JavaScript modules. Contains a single loader named svelte. Override this if you want a different loader for HTML files.
  • compile: Only necessary file extensions added.
5.0.0

5 years ago

4.1.0

6 years ago

4.0.0

7 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.0

7 years ago