-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
50 lines (47 loc) · 1.18 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
/**
* 配置修改,参考引入antd
*/
const withPlugins = require("next-compose-plugins")
const withPluginAntd = require("next-plugin-antd")
const lessToJS = require("less-vars-to-js")
const fs = require("fs")
const path = require("path")
const withCss = require("@zeit/next-css")
const themeVariables = lessToJS(
fs.readFileSync(path.resolve(__dirname, "./styles/antdCustom.less"), "utf8")
)
const nextConfig = {
webpack(config, options) {
config.module.rules.push({
test: /\.md$/,
use: "raw-loader",
})
return config
},
}
module.exports = withPlugins(
[
[
withPluginAntd,
{
antdThemeVariables: themeVariables,
lessLoaderOptions: {
lessOptions: {
javascriptEnabled: true,
},
},
},
],
[
withCss,
{
cssModules: true,
cssLoaderOptions: {
importLoaders: 1,
localIdentName: "[local]___[hash:base64:5]",
},
},
],
],
nextConfig
)