JSPM

  • Created
  • Published
  • Downloads 20654
  • Score
    100M100P100Q134438F
  • License MIT

esbuild plugin to resolve .svelte files

Package Exports

  • esbuild-svelte

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (esbuild-svelte) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

esbuild-svelte

npm version

Plugin to compile svelte modules for esbuild.

Install

Install both this plugin and esbuild (esbuild must be above 0.8.1).

An super simple build script looks like

require('esbuild').build({
  entryPoints: ['app.js'],
  bundle: true,
  outfile: 'out.js',
  plugins: [require('esbuild-svelte')],
  logLevel: 'info',
}).catch(() => process.exit(1))

The examples folder of this repository is a great starting off point as well if you change the require('../index') in the buildscript to require('esbuild-svelte').

Advanced

If it is desired to change Svelte compiler options, simply import esbuild-svelte/configurable instead of esbuild-svelte and call it as a function. For example, to enable dev mode in Svelte instead of require('esbuild-svelte'), use require('esbuild-svelte/configurable')({dev: true}). This API may change in the future

TODO

  • Figure out CSS support
  • Add more functionality
  • Add Svelte pre-processor support