-
Notifications
You must be signed in to change notification settings - Fork 5
/
config-overrides.js
35 lines (34 loc) · 1.25 KB
/
config-overrides.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
const {
override, fixBabelImports, addLessLoader,
addWebpackAlias, addDecoratorsLegacy, addWebpackPlugin
} = require('customize-cra');
const path = require('path');
const webpack = require('webpack');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = override(
fixBabelImports('import', {
libraryName: 'antd',
libraryDirectory: 'es',
style: true
}),
addLessLoader({
javascriptEnabled: true,
modifyVars: { '@primary-color': '#1890ff' }
}),
addWebpackAlias({
'@utils': path.resolve(__dirname, 'src/utils'),
'@config': path.resolve(__dirname, 'src/config'),
'@pages': path.resolve(__dirname, 'src/pages'),
'@router': path.resolve(__dirname, 'src/router'),
'@com': path.resolve(__dirname, 'src/components'),
'@img': path.resolve(__dirname, 'src/img'),
'@axios': path.resolve(__dirname, 'src/axios'),
'@store': path.resolve(__dirname, 'src/store')
}),
addDecoratorsLegacy(),
addWebpackPlugin(new webpack.ProgressPlugin()),
addWebpackPlugin(new MiniCssExtractPlugin({
filename: 'static/css/[name].[contenthash:8].css',
chunkFilename: 'static/css/[name].[contenthash:8].chunk.css',
})),
);