Skip to content

Commit 61ce615

Browse files
authored
fix: should not enable cssnano in dev (#8008)
1 parent 11727a0 commit 61ce615

File tree

4 files changed

+652
-1
lines changed

4 files changed

+652
-1
lines changed

.changeset/fuzzy-shoes-invent.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@modern-js/uni-builder': patch
3+
---
4+
5+
fix: should not enable cssnano when injectStyles is enabled in dev environment
6+
7+
fix: 开启 injectStyles 时 dev 环境下不启用 cssnano

packages/cli/uni-builder/src/shared/plugins/postcss.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const pluginPostcss = (
7070
const cssSupport = getCssSupport(config.output.overrideBrowserslist!);
7171
const enableExtractCSS = !config.output?.injectStyles;
7272

73-
const enableCssMinify = !enableExtractCSS && isProd;
73+
const enableCssMinify = !enableExtractCSS && isProd();
7474

7575
const cssnanoOptions: Options = {
7676
preset: [

0 commit comments

Comments
 (0)