Skip to content

Commit

Permalink
fix(webpack): ensure NODE_ENV is defaulted to development for dev-ser…
Browse files Browse the repository at this point in the history
…ver, and HMR works
  • Loading branch information
jaysoo committed Feb 10, 2023
1 parent 47a4ff4 commit dd85383
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/webpack/src/executors/dev-server/dev-server.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export async function* devServerExecutor(
serveOptions: WebDevServerOptions,
context: ExecutorContext
) {
// Default to dev mode so builds are faster and HMR mode works better.
process.env.NODE_ENV ??= 'development';

const { root: projectRoot, sourceRoot } =
context.projectsConfigurations.projects[context.projectName];
const buildOptions = normalizeOptions(
Expand Down
1 change: 1 addition & 0 deletions packages/webpack/src/plugins/write-index-html-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ export class WriteIndexHtmlPlugin {
name: string;
extension: string;
}[] = [];

for (const { file, name, extension, initial } of files) {
if (name && initial && extensionFilter.includes(extension)) {
filteredFiles.push({ file, extension, name });
Expand Down

0 comments on commit dd85383

Please sign in to comment.