Skip to content

Commit

Permalink
enable nohoist by default
Browse files Browse the repository at this point in the history
  • Loading branch information
malash committed Nov 1, 2023
1 parent acc1d31 commit 2ee8e24
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/webpack-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ export class GojiWebpackPlugin implements webpack.WebpackPluginInstance {
options: GojiWebpackPluginOptions,
): GojiWebpackPluginRequiredOptions {
const nodeEnv = options.nodeEnv ?? process.env.NODE_ENV ?? 'development';
const isProd = nodeEnv === 'production';

return {
target: options.target,
nodeEnv,
maxDepth: options.maxDepth ?? 5,
minimize: options.minimize ?? nodeEnv !== 'development',
nohoist: {
enable: options?.nohoist?.enable ?? isProd,
enable: options?.nohoist?.enable ?? true,
maxPackages: options?.nohoist?.maxPackages ?? 1,
test: options?.nohoist?.test,
},
Expand Down

0 comments on commit 2ee8e24

Please sign in to comment.