Package Exports
- @svitejs/vite-plugin-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 (@svitejs/vite-plugin-svelte) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@svitejs/vite-plugin-svelte
usage
// vite.config.js
const svelte = require('@svitejs/vite-plugin-svelte')
const { defineConfig } = require('vite')
module.exports = defineConfig(({ command, mode }) => {
const isProduction = mode === 'production'
return {
plugins: [
svelte({
/* inline options here */
})
],
build: {
minify: isProduction
}
}
})
Options
vite-plugin-svelte reads the vite configuration and uses an appropriate default configuration
It also loads svelte.config.js
(or svelte.config.cjs
) from the configured vite.root
directory automatically.
Options are applied in the following order:
- vite-plugin-svelte defaults
- svelte.config.js in vite.root
- inline options passed in vite.config.js
It supports all options from rollup-plugin-svelte and some additional options to tailor the plugin to your needs.
For more Information check options.ts
License
MIT