Skip to content

Commit 97f4cba

Browse files
alan-agius4clydin
authored andcommitted
fix(@angular-devkit/build-angular): disable CSS declaration sorting optimizations
CSS declaration orders matters in some cases. This optimization is currently causing broken CSS output. Closes #20693
1 parent e4959d1 commit 97f4cba

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

packages/angular_devkit/build_angular/src/webpack/plugins/optimize-css-webpack-plugin.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,19 @@ export class OptimizeCssWebpackPlugin {
9797
}
9898

9999
const cssNanoOptions: cssNano.CssNanoOptions = {
100-
preset: ['default', {
101-
// Disable SVG optimizations, as this can cause optimizations which are not compatible in all browsers.
102-
svgo: false,
103-
// Disable `calc` optimizations, due to several issues. #16910, #16875, #17890
104-
calc: false,
105-
}],
100+
preset: [
101+
'default',
102+
{
103+
// Disable SVG optimizations, as this can cause optimizations which are not compatible in all browsers.
104+
svgo: false,
105+
// Disable `calc` optimizations, due to several issues. #16910, #16875, #17890
106+
calc: false,
107+
// Disable CSS rules sorted due to several issues #20693
108+
// https://github.com/ionic-team/ionic-framework/issues/23266 and
109+
// https://github.com/cssnano/cssnano/issues/1054
110+
cssDeclarationSorter: false,
111+
},
112+
],
106113
};
107114

108115
const postCssOptions: ProcessOptions = {

0 commit comments

Comments
 (0)