add node env to packages in build script

This commit is contained in:
Steve Ruiz 2022-02-03 11:14:26 +00:00
parent 014bfbc841
commit 89c1c4a4f4
5 changed files with 30 additions and 0 deletions

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(

View file

@ -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(