Skip to content

Commit

Permalink
fix: set NODE_ENV if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Mar 13, 2021
1 parent f997c9c commit 101c687
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions integrations/base-integration/src/webpack-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ export const buildBundle = async ({
onEndBuild?: OnEndBuild;
}): Promise<any> => {
const mode = options?.mode || process.env.NODE_ENV;
if (typeof process.env.NODE_ENV === 'undefined') {
process.env.NODE_ENV = mode;
}
const buildOptions = createOptions(options);
const onBundle: CompilerCallbackFn = async ({ store }) => {
await postBuild(
Expand Down Expand Up @@ -119,6 +116,11 @@ export const asyncWebpackConfig = async ({
config: any;
options?: BuildProps;
}): Promise<any> => {
const mode = config.mode;
if (typeof process.env.NODE_ENV === 'undefined') {
process.env.NODE_ENV = mode;
process.env.BABEL_ENV = mode;
}
await buildBundle({
options,
});
Expand Down

0 comments on commit 101c687

Please sign in to comment.