-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
64 lines (58 loc) · 1.4 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
const withCSS = require('@zeit/next-css');
const withImages = require('next-images');
const withFonts = require('next-fonts');
const withSASS = require('@zeit/next-sass');
const compose = require('next-compose');
const withTM = require('next-plugin-transpile-modules');
const cssConfig = {
cssModules: true,
cssLoaderOptions: {
importLoaders: 1,
localIdentName: "[local]___[hash:base64:5]",
url: false
}
};
const fontsConfig = {};
const imagesConfig = {};
const sassConfig = {
cssModules: true,
webpack: (config) => {
config.module.rules.push({
test: /\.(eot|woff|woff2|ttf|svg|png|jpg|gif)$/,
use: {
loader: 'url-loader',
options: {
limit: 100000,
name: '/static/images/[name].[ext]'
},
},
},
)
return config
}
};
const tmConfig = {
transpileModules: ['velocity-trade-date-picker'],
};
function disableCacheDirectory(config) {
config.module.rules = config.module.rules.map(rule => {
if (rule.use.loader && rule.use.loader === 'next-babel-loader') {
rule.use.options.cacheDirectory = false;
}
return rule;
});
return config;
}
module.exports = compose([
[withTM, tmConfig],
[withCSS, cssConfig],
[withFonts, fontsConfig],
[withImages, imagesConfig],
[withSASS, sassConfig],
{
webpack: (config) => {
// disableCacheDirectory(config);
return config;
},
},
]);