diff --git a/packages/core/scripts/build.js b/packages/core/scripts/build.js index ffc0a6076..e23716de5 100644 --- a/packages/core/scripts/build.js +++ b/packages/core/scripts/build.js @@ -29,6 +29,9 @@ async function main() { external: Object.keys(pkg.dependencies ?? {}).concat(Object.keys(pkg.peerDependencies ?? {})), metafile: true, sourcemap: true, + define: { + 'process.env.NODE_ENV': '"production"', + }, }) const esmResult = esbuild.buildSync({ @@ -44,6 +47,9 @@ async function main() { external: Object.keys(pkg.dependencies).concat(Object.keys(pkg.peerDependencies)), metafile: true, sourcemap: true, + define: { + 'process.env.NODE_ENV': '"production"', + }, }) const esmSize = Object.values(esmResult.metafile.outputs).reduce( diff --git a/packages/curve/scripts/build.js b/packages/curve/scripts/build.js index a50b2ccf1..97fe0ad4a 100644 --- a/packages/curve/scripts/build.js +++ b/packages/curve/scripts/build.js @@ -26,6 +26,9 @@ async function main() { tsconfig: './tsconfig.build.json', metafile: false, sourcemap: true, + define: { + 'process.env.NODE_ENV': '"production"', + }, }) const esmResult = esbuild.buildSync({ @@ -38,6 +41,9 @@ async function main() { tsconfig: './tsconfig.build.json', metafile: true, sourcemap: true, + define: { + 'process.env.NODE_ENV': '"production"', + }, }) const esmSize = Object.values(esmResult.metafile.outputs).reduce( diff --git a/packages/intersect/scripts/build.js b/packages/intersect/scripts/build.js index 2b9b2bafb..2757a10f7 100644 --- a/packages/intersect/scripts/build.js +++ b/packages/intersect/scripts/build.js @@ -27,6 +27,9 @@ async function main() { external: Object.keys(pkg.dependencies), metafile: true, sourcemap: true, + define: { + 'process.env.NODE_ENV': '"production"', + }, }) const esmResult = esbuild.buildSync({ @@ -40,6 +43,9 @@ async function main() { external: Object.keys(pkg.dependencies), metafile: true, sourcemap: true, + define: { + 'process.env.NODE_ENV': '"production"', + }, }) const esmSize = Object.values(esmResult.metafile.outputs).reduce( diff --git a/packages/tldraw/scripts/build.js b/packages/tldraw/scripts/build.js index c289c650b..7a2b5b800 100644 --- a/packages/tldraw/scripts/build.js +++ b/packages/tldraw/scripts/build.js @@ -29,6 +29,9 @@ async function main() { external: Object.keys(pkg.dependencies).concat(Object.keys(pkg.peerDependencies)), metafile: true, sourcemap: true, + define: { + 'process.env.NODE_ENV': '"production"', + }, }) const esmResult = esbuild.buildSync({ @@ -44,6 +47,9 @@ async function main() { external: Object.keys(pkg.dependencies).concat(Object.keys(pkg.peerDependencies)), metafile: true, sourcemap: true, + define: { + 'process.env.NODE_ENV': '"production"', + }, }) const esmSize = Object.values(esmResult.metafile.outputs).reduce( diff --git a/packages/vec/scripts/build.js b/packages/vec/scripts/build.js index a50b2ccf1..97fe0ad4a 100644 --- a/packages/vec/scripts/build.js +++ b/packages/vec/scripts/build.js @@ -26,6 +26,9 @@ async function main() { tsconfig: './tsconfig.build.json', metafile: false, sourcemap: true, + define: { + 'process.env.NODE_ENV': '"production"', + }, }) const esmResult = esbuild.buildSync({ @@ -38,6 +41,9 @@ async function main() { tsconfig: './tsconfig.build.json', metafile: true, sourcemap: true, + define: { + 'process.env.NODE_ENV': '"production"', + }, }) const esmSize = Object.values(esmResult.metafile.outputs).reduce(