diff --git a/package-lock.json b/package-lock.json index 691d89a596..2ec7f04338 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7848,6 +7848,27 @@ } } }, + "node_modules/@rollup/plugin-replace": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-5.0.5.tgz", + "integrity": "sha512-rYO4fOi8lMaTg/z5Jb+hKnrHHVn8j2lwkqwyS4kTRhKyWOLf2wST2sWXr4WzWiTcoHTp2sTjqUbqIj2E39slKQ==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "magic-string": "^0.30.3" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, "node_modules/@rollup/pluginutils": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", @@ -36843,6 +36864,7 @@ "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-replace": "^5.0.5", "@waku/build-utils": "*", "cspell": "^8.6.1", "interface-datastore": "^8.2.10", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index a27686393e..1d3c74abea 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -80,6 +80,7 @@ "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-replace": "^5.0.5", "@waku/build-utils": "*", "cspell": "^8.6.1", "interface-datastore": "^8.2.10", diff --git a/packages/sdk/rollup.config.js b/packages/sdk/rollup.config.js index 4d0757b1c9..492ad48b8e 100644 --- a/packages/sdk/rollup.config.js +++ b/packages/sdk/rollup.config.js @@ -1,6 +1,7 @@ import commonjs from "@rollup/plugin-commonjs"; import json from "@rollup/plugin-json"; import { nodeResolve } from "@rollup/plugin-node-resolve"; +import replace from "@rollup/plugin-replace"; import { extractExports } from "@waku/build-utils"; import * as packageJson from "./package.json" assert { type: "json" }; @@ -19,6 +20,9 @@ export default { nodeResolve({ browser: true, preferBuiltins: false + }), + replace({ + "process?.env?.NODE_ENV": JSON.stringify("production") }) ] };