From 8763173d2e370cb69a991cdbfa5cdd79f288b0be Mon Sep 17 00:00:00 2001 From: Sasha <118575614+weboko@users.noreply.github.com> Date: Tue, 9 Apr 2024 13:43:28 +0300 Subject: [PATCH] fix: make rollup replace env var (#1951) * fix: make rollup replace env var * up version * up package name * up name * update replace pattern --- package-lock.json | 22 ++++++++++++++++++++++ packages/sdk/package.json | 1 + packages/sdk/rollup.config.js | 4 ++++ 3 files changed, 27 insertions(+) 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") }) ] };