mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 17:35:57 +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?: {
|
esbuild?: {
|
||||||
options?: EsbuildOptions
|
options?: EsbuildOptions
|
||||||
}
|
}
|
||||||
|
experiments?: {
|
||||||
|
wasm?: boolean
|
||||||
|
}
|
||||||
moduleSideEffects: string[]
|
moduleSideEffects: string[]
|
||||||
renderer: string
|
renderer: string
|
||||||
serveStatic: boolean
|
serveStatic: boolean
|
||||||
@ -94,6 +97,7 @@ export function getNitroContext (nuxtOptions: NuxtOptions, input: NitroInput): N
|
|||||||
node: undefined,
|
node: undefined,
|
||||||
preset: undefined,
|
preset: undefined,
|
||||||
rollupConfig: undefined,
|
rollupConfig: undefined,
|
||||||
|
experiments: {},
|
||||||
moduleSideEffects: ['unenv/runtime/polyfill/'],
|
moduleSideEffects: ['unenv/runtime/polyfill/'],
|
||||||
renderer: undefined,
|
renderer: undefined,
|
||||||
serveStatic: undefined,
|
serveStatic: undefined,
|
||||||
|
@ -143,7 +143,9 @@ export const getRollupConfig = (nitroContext: NitroContext) => {
|
|||||||
rollupConfig.plugins.push(raw())
|
rollupConfig.plugins.push(raw())
|
||||||
|
|
||||||
// WASM import support
|
// WASM import support
|
||||||
rollupConfig.plugins.push(wasmPlugin())
|
if (nitroContext.experiments.wasm) {
|
||||||
|
rollupConfig.plugins.push(wasmPlugin())
|
||||||
|
}
|
||||||
|
|
||||||
// https://github.com/rollup/plugins/tree/master/packages/replace
|
// https://github.com/rollup/plugins/tree/master/packages/replace
|
||||||
rollupConfig.plugins.push(replace({
|
rollupConfig.plugins.push(replace({
|
||||||
|
Loading…
Reference in New Issue
Block a user