Skip to content

Commit

Permalink
Force production environment for CLI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeasday committed Nov 30, 2023
1 parent 602d90c commit 86f7878
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion node-src/tasks/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ export const buildStorybook = async (ctx: Context) => {
ctx.log.debug('Running build command:', ctx.buildCommand);
ctx.log.debug('Runtime metadata:', JSON.stringify(ctx.runtimeMetadata, null, 2));

const subprocess = execaCommand(ctx.buildCommand, { stdio: [null, logFile, logFile], signal });
const subprocess = execaCommand(ctx.buildCommand, {
stdio: [null, logFile, logFile],
signal,
env: { NODE_ENV: 'production' },
});
await Promise.race([subprocess, timeoutAfter(ctx.env.STORYBOOK_BUILD_TIMEOUT)]);
} catch (e) {
signal?.throwIfAborted();
Expand Down

0 comments on commit 86f7878

Please sign in to comment.