forked from SolidZORO/next-plugin-antd-less
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
41 lines (39 loc) · 1021 Bytes
/
index.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
/* eslint-disable no-param-reassign, consistent-return, no-restricted-syntax */
const { overrideWebpackConfig } = require('./overrideWebpackConfig');
// fix: prevents error when .less files are required by node
if (require && require.extensions) {
require.extensions['.less'] = () => {
};
}
module.exports = (
pluginOptions = {
// optional
modifyVars: undefined,
// optional
lessVarsFilePath: undefined,
// optional
lessVarsFilePathAppendToEndOfContent: undefined,
//
// optional / https://github.com/webpack-contrib/css-loader#object
cssLoaderOptions: {
esModule: false,
sourceMap: false,
modules: {
mode: 'local',
},
},
// optional / https://github.com/webpack-contrib/less-loader#options
lessLoaderOptions: undefined,
},
) => {
return {
...pluginOptions,
webpack(webpackConfig, nextConfig) {
return overrideWebpackConfig({
webpackConfig,
nextConfig,
pluginOptions
});
}
};
};