From f2da50dd6f94df419f1f6d5f7edc347b51544d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sampo=20Kivist=C3=B6?= Date: Tue, 10 Oct 2023 18:25:02 +0300 Subject: [PATCH] Fix preventAssignment warning --- docs/build.js | 1 + scripts/fakedom/build.js | 7 ++++--- scripts/rollup/plugins/index.js | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/build.js b/docs/build.js index c2a34ed18..e752a4e3a 100644 --- a/docs/build.js +++ b/docs/build.js @@ -21,6 +21,7 @@ console.log(resolvePkg('inferno')); // see below for details on the options const plugins = [ replace({ + preventAssignment: true, 'process.env.NODE_ENV': '"production"', sourcemap: false }), diff --git a/scripts/fakedom/build.js b/scripts/fakedom/build.js index d13803822..3e4cfda08 100644 --- a/scripts/fakedom/build.js +++ b/scripts/fakedom/build.js @@ -1,9 +1,9 @@ import {rollup} from "rollup"; import { existsSync, readdirSync, statSync } from "fs"; -import commonjsPlugin from "rollup-plugin-commonjs"; -import nodeResolvePlugin from "rollup-plugin-node-resolve"; +import commonjsPlugin from "@rollup/plugin-commonjs"; +import nodeResolvePlugin from "@rollup/plugin-node-resolve"; import { dirname, join, resolve } from "path"; -import replace from "rollup-plugin-replace"; +import replace from "@rollup/plugin-replace"; import terser from '@rollup/plugin-terser'; import alias from "@rollup/plugin-alias"; import { fileURLToPath } from "url"; @@ -22,6 +22,7 @@ console.log(resolvePkg('inferno')); // see below for details on the options const plugins = [ replace({ + preventAssignment: true, 'process.env.NODE_ENV': '"production"', sourcemap: false }), diff --git a/scripts/rollup/plugins/index.js b/scripts/rollup/plugins/index.js index ffc22d509..711720317 100644 --- a/scripts/rollup/plugins/index.js +++ b/scripts/rollup/plugins/index.js @@ -31,6 +31,7 @@ export function createPlugins(version, options) { ); const replaceValues = { + preventAssignment: true, 'process.env.INFERNO_VERSION': JSON.stringify(options.version) };