mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
refactor(nitro): move wasm support behind a flag (nitro.experiments.wasm
) (#1045)
This commit is contained in:
parent
6e787c20ec
commit
6acfdcd0f7
@ -35,6 +35,9 @@ export interface NitroContext {
|
||||
esbuild?: {
|
||||
options?: EsbuildOptions
|
||||
}
|
||||
experiments?: {
|
||||
wasm?: boolean
|
||||
}
|
||||
moduleSideEffects: string[]
|
||||
renderer: string
|
||||
serveStatic: boolean
|
||||
@ -94,6 +97,7 @@ export function getNitroContext (nuxtOptions: NuxtOptions, input: NitroInput): N
|
||||
node: undefined,
|
||||
preset: undefined,
|
||||
rollupConfig: undefined,
|
||||
experiments: {},
|
||||
moduleSideEffects: ['unenv/runtime/polyfill/'],
|
||||
renderer: undefined,
|
||||
serveStatic: undefined,
|
||||
|
@ -143,7 +143,9 @@ export const getRollupConfig = (nitroContext: NitroContext) => {
|
||||
rollupConfig.plugins.push(raw())
|
||||
|
||||
// WASM import support
|
||||
if (nitroContext.experiments.wasm) {
|
||||
rollupConfig.plugins.push(wasmPlugin())
|
||||
}
|
||||
|
||||
// https://github.com/rollup/plugins/tree/master/packages/replace
|
||||
rollupConfig.plugins.push(replace({
|
||||
|
Loading…
Reference in New Issue
Block a user