-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
43 lines (38 loc) · 1001 Bytes
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// // module.exports = {
// // module: {
// // rules: [
// // {
// // test: /\.css$/,
// // use: ["style-loader", "css-loader"]
// // }
// // ]
// // }
// // };
// // module.exports = withCSS();
// const withCSS = require("@zeit/next-css");
const withTypescript = require("@zeit/next-typescript");
// module.exports = withCSS(withTypescript());
// next.config.js
const withCSS = require("@zeit/next-css");
function HACK_removeMinimizeOptionFromCssLoaders(config) {
console.warn(
"HACK: Removing `minimize` option from `css-loader` entries in Webpack config"
);
config.module.rules.forEach(rule => {
if (Array.isArray(rule.use)) {
rule.use.forEach(u => {
if (u.loader === "css-loader" && u.options) {
delete u.options.minimize;
}
});
}
});
}
module.exports = withTypescript(
withCSS({
webpack(config) {
HACK_removeMinimizeOptionFromCssLoaders(config);
return config;
}
})
);