-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
31 lines (29 loc) · 997 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
const path = require('path');
const withSass = require('@zeit/next-sass');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const {ANALYZE} = process.env;
const commonsChunkConfig = require('@zeit/next-css/commons-chunk-config');
module.exports = withSass({
cssModules: true,
cssLoaderOptions: {
modules: true,
localIdentName: '[name]__[local]___[hash:base64:5]',
minimize: true,
sourceMap: true,
importLoaders: 2
},
sassLoaderOptions: {
includePaths: ["/scss/utils.scss"]
},
webpack: function (config) {
if (ANALYZE) {
config.plugins.push(new BundleAnalyzerPlugin({
analyzerMode: 'server',
analyzerPort: 3000,
openAnalyzer: true
}))
}
return commonsChunkConfig(config, /\.(sass|scss|css)$/)
}
}
);