Skip to content

Commit

Permalink
fix(bundling): default Node scriptType to CommonJS since it has the w…
Browse files Browse the repository at this point in the history
…idest compatibility

Fixes nrwl#15125
  • Loading branch information
jaysoo committed Mar 6, 2023
1 parent b74fc1b commit 5aad65b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/webpack/src/utils/with-nx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ export function withNx(pluginOptions?: WithNxOptions): NxWebpackPlugin {
hashFunction: 'xxhash64',
// Disabled for performance
pathinfo: false,
scriptType: 'module' as const,
// Use CJS for Node since it has the widest support.
scriptType: options.target === 'node' ? undefined : ('module' as const),
},
watch: options.watch,
watchOptions: {
Expand Down

0 comments on commit 5aad65b

Please sign in to comment.