-
Notifications
You must be signed in to change notification settings - Fork 0
/
craco.config.js
46 lines (44 loc) · 1.52 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
const path = require("path");
const WebpackBar = require("webpackbar");
const AntdDayjsWebpackPlugin = require("antd-dayjs-webpack-plugin");
const WorkerPlugin = require("worker-plugin");
const resolve = (dir) => path.resolve(__dirname, dir);
module.exports = ({ env: webpackEnv }) => {
return {
plugins: [],
style: {
postcss: {
plugins: [require("tailwindcss"), require("autoprefixer")],
},
},
webpack: {
plugins: [
new WebpackBar({
name: webpackEnv !== "production" ? "正在启动" : "正在打包",
color: "#fa8c16",
}),
new AntdDayjsWebpackPlugin(),
new WorkerPlugin(),
],
alias: {
"@": resolve("src"),
"@app": resolve("src/app"),
"@pages": resolve("src/pages"),
"@layout": resolve("src/layout"),
"@components": resolve("src/components"),
"@store": resolve("src/store"),
"@utils": resolve("src/utils"),
"@assets": resolve("src/assets"),
"@router": resolve("src/router"),
"@config": resolve("src/config"),
"@services": resolve("src/services"),
"@hooks": resolve("src/hooks"),
"@types": resolve("src/types"),
},
},
babel: {},
devServer: {
// open: false
},
};
};