fix: js/css are minified when both minify.js and minify.css are false#2865
fix: js/css are minified when both minify.js and minify.css are false#2865chenjiahan merged 1 commit intoweb-infra-dev:mainfrom
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
packages/core/src/helpers.ts
Outdated
| } | ||
|
|
||
| return { | ||
| minifyJs: !(minify.js === false || !isProd), |
There was a problem hiding this comment.
I think minify.js can be enabled in dev mode
There was a problem hiding this comment.
minimize is always disabled in dev mode before, even when output.minify is true. (btw this function is moved from plugin/minimize.ts)
shall i make minify available in dev mode since this PR?
|
|
||
| const { minifyJs, minifyCss, jsOptions, cssOptions } = | ||
| parseMinifyOptions(config); | ||
| chain.optimization.minimize(minifyJs || minifyCss); |
There was a problem hiding this comment.
chain.optimization.minimize(minifyJs || minifyCss); is set by the basic plugin, should we set it here again?
There was a problem hiding this comment.
chain.optimization.minimize(minifyJs || minifyCss);is set by the basic plugin, should we set it here again?
it is for a such edge case that pluginBasic is not applied - typically seen in test cases.
actually i'm not sure why it's in pluginBasic
There was a problem hiding this comment.
i've refined this PR, please check again.
| } | ||
| const { minify: _minify } = config.output; | ||
| const minify = | ||
| _minify && typeof _minify === 'object' |
There was a problem hiding this comment.
I prefer to use the former implementation because it seems simpler. 😂
|
^_^ |


Summary
This PR fixes the bug that js/css are minified when
minifyis{ js: false, css: false }.Related Links
Checklist