-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
31 lines (30 loc) · 871 Bytes
/
next.config.js
File metadata and controls
31 lines (30 loc) · 871 Bytes
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 withLess = require('@zeit/next-less');
const path = require('path');
const withSourceMaps = require('@zeit/next-source-maps')();
module.exports = withSourceMaps(
withLess({
distDir: 'build',
cssModules: true,
cssLoaderOptions: {
importLoaders: 1,
localIdentName: '[name]___[local]___[hash:base64:5]',
},
lessLoaderOptions: {
javascriptEnabled: true,
},
webpack(config) {
config.module.rules.push({
test: /\.js$/,
enforce: 'pre',
include: [path.resolve('components'), path.resolve('pages')],
});
config.devtool = 'cheap-module-inline-source-map';
config.resolve.alias = {
...config.resolve.alias,
'@pages': path.join(__dirname, '.', 'pages'),
'@components': path.join(__dirname, '.', 'components'),
};
return config;
},
}),
);