add preventAssignment option

This commit is contained in:
Pooya Parsa 2021-02-22 11:31:45 +01:00
parent 709611941b
commit 29409f064f

View File

@ -111,6 +111,8 @@ export const getRollupConfig = (nitroContext: NitroContext) => {
// 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({
// @ts-ignore https://github.com/rollup/plugins/pull/810
preventAssignment: true,
values: { values: {
'process.env.NODE_ENV': nitroContext._nuxt.dev ? '"development"' : '"production"', 'process.env.NODE_ENV': nitroContext._nuxt.dev ? '"development"' : '"production"',
'typeof window': '"undefined"', 'typeof window': '"undefined"',