diff --git a/packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.ts b/packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.ts index 88cbebc5a4..802114b9c7 100644 --- a/packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.ts +++ b/packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.ts @@ -96,30 +96,25 @@ function applyNxIndependentConfig( ...config.output, libraryTarget: (config as Configuration).output?.libraryTarget ?? - options.target === 'node' - ? 'commonjs' - : undefined, + (options.target === 'node' ? 'commonjs' : undefined), path: config.output?.path ?? (options.outputPath ? path.join(options.root, options.outputPath) : undefined), filename: - config.output?.filename ?? options.outputHashing - ? `[name]${hashFormat.script}.js` - : '[name].js', + config.output?.filename ?? + (options.outputHashing ? `[name]${hashFormat.script}.js` : '[name].js'), chunkFilename: - config.output?.chunkFilename ?? options.outputHashing - ? `[name]${hashFormat.chunk}.js` - : '[name].js', + config.output?.chunkFilename ?? + (options.outputHashing ? `[name]${hashFormat.chunk}.js` : '[name].js'), hashFunction: config.output?.hashFunction ?? 'xxhash64', // Disabled for performance pathinfo: config.output?.pathinfo ?? false, // Use CJS for Node since it has the widest support. scriptType: - config.output?.scriptType ?? options.target === 'node' - ? undefined - : 'module', + config.output?.scriptType ?? + (options.target === 'node' ? undefined : 'module'), }; config.watch = options.watch;