Skip to content

svelteWrapperPlugin

Wraps the esbuild-svelte plugin to ensure that the correct format is used.

esbuild-svelte and svelte-preprocess are loaded when the plugin is set up, not when this module is imported. When the svelte package is not installed, a build with no .svelte file succeeds, and a build that reaches one fails with an error that names the missing package.

Import:

import { svelteWrapperPlugin } from '@mnaoumov/typescript-dev-toolkit/bundlers/esbuild-impl/svelte-wrapper-plugin';

Signature:

function svelteWrapperPlugin(isProductionBuild: boolean): Plugin

Parameters:

Parameter Type Description
isProductionBuild boolean Whether the build is a production build.

Returns: Plugin — The esbuild plugin.