Skip to content

Commit ec96611

Browse files
committed
fix vendor CSS not generating in production mode
1 parent 71d3cb4 commit ec96611

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

config/webpack.config.ts/loaders.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ const cssModuleLoaderClient = {
5656
},
5757
},
5858
],
59+
// Don't consider CSS imports dead code even if the
60+
// containing package claims to have no side effects.
61+
// Remove this when webpack adds a warning or an error for this.
62+
// See https://github.com/webpack/webpack/issues/6571
63+
sideEffects: true,
5964
};
6065

6166
const cssLoaderClient = {
@@ -72,6 +77,11 @@ const cssLoaderClient = {
7277
},
7378
},
7479
],
80+
// Don't consider CSS imports dead code even if the
81+
// containing package claims to have no side effects.
82+
// Remove this when webpack adds a warning or an error for this.
83+
// See https://github.com/webpack/webpack/issues/6571
84+
sideEffects: true,
7585
};
7686

7787
const cssModuleLoaderServer = {
@@ -93,12 +103,22 @@ const cssModuleLoaderServer = {
93103
},
94104
},
95105
],
106+
// Don't consider CSS imports dead code even if the
107+
// containing package claims to have no side effects.
108+
// Remove this when webpack adds a warning or an error for this.
109+
// See https://github.com/webpack/webpack/issues/6571
110+
sideEffects: true,
96111
};
97112

98113
const cssLoaderServer = {
99114
test: cssRegex,
100115
exclude: cssModuleRegex,
101116
use: [MiniCssExtractPlugin.loader, require.resolve('css-loader')],
117+
// Don't consider CSS imports dead code even if the
118+
// containing package claims to have no side effects.
119+
// Remove this when webpack adds a warning or an error for this.
120+
// See https://github.com/webpack/webpack/issues/6571
121+
sideEffects: true,
102122
};
103123

104124
const urlLoaderClient = {

0 commit comments

Comments
 (0)