-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcraco.config.js
55 lines (54 loc) · 1.46 KB
/
craco.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
const path = require('path');
// const { ESLINT_MODES } = require("@craco/craco");
const webpack = require("webpack");
const WebpackBar = require('webpackbar');
const AntdDayjsWebpackPlugin = require('antd-dayjs-webpack-plugin');
const darkTheme = require('@ant-design/dark-theme').default;
const CracoAntdPlugin = require('craco-antd');
module.exports = {
eslint: {
enable: false,
// mode: ESLINT_MODES.file
},
plugins: [
{
plugin: CracoAntdPlugin,
options: {
customizeTheme: darkTheme,
},
},
],
webpack: {
configure: {
resolve: {
extensions: ['.js', '.jsx', '.json', '.png', '.webp', '.jpg'],
},
output: {
publicPath: process.env.NODE_ENV === 'development' ? '/' : '/grasscutter-web-tools'
}
},
alias: {
"@styles": path.resolve(__dirname, "src/styles"),
"@images": path.resolve(__dirname, "src/images"),
"@image": path.resolve(__dirname, "src/images"),
"@views": path.resolve(__dirname, "src/views"),
"@": path.resolve(__dirname, "src"),
},
plugins: [
new webpack.ProgressPlugin(),
new WebpackBar(),
new AntdDayjsWebpackPlugin(),
],
},
jest: {
configure: {
moduleNameMapper: {
"@": "<rootDir>/src/$1",
"@styles": "<rootDir>/src/styles/$1",
"@images": "<rootDir>/src/images/$1",
"@image": "<rootDir>/src/images/$1",
"@views": "<rootDir>/src/views/$1",
}
}
}
}