-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.umirc.ts
79 lines (77 loc) · 2.08 KB
/
.umirc.ts
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import { defineConfig } from '@umijs/max';
import routerConfig from './src/routes';
import zhCN from 'antd/locale/zh_CN';
const proxyConfig = require('./src/config/proxyConfig');
const path = require('path');
const repo = 'Antd-CustomComponent';
const content = `(function(){
let divs = document.createElement('div');
divs.className = 'snow-container';
document.querySelector('body')?.appendChild(divs);
})()`;
export default defineConfig({
define: {
'process.env': process.env,
},
base: process.env.NODE_ENV === 'production' ? '/Antd-CustomComponent/' : '/',
publicPath: process.env.NODE_ENV === 'production' ? 'http://wangxince.site/Antd-CustomComponent/' : '/',
routes: routerConfig,
layout: false,
// layout: {
// title: '公众crud组件"',
// contentWidth: 'Fluid',
// locale: false,
// },
locale: {
// 默认使用 src/locales/zh-CN.ts 作为多语言文件
antd: true,
default: 'zh-CN',
baseSeparator: '-',
},
codeSplitting: {
jsStrategy: 'granularChunks',
},
devtool: process.env.NODE_ENV === 'production' ? 'eval' : 'source-map',
antd: {
configProvider: {
locale: zhCN,
},
theme: { '@primary-color': '#2B5FDC' },
},
// metas: [
// {
// 'http-equiv': 'Content-Security-Policy',
// content: 'upgrade-insecure-requests',
// },
// { 'http-equiv': 'Cache-control', content: 'no-cache' },
// { 'http-equiv': 'Cache', content: 'no-cache' },
// ],
fastRefresh: true,
proxy: proxyConfig,
clickToComponent: {},
dva: {},
access: {},
model: {},
initialState: {},
request: {},
hash: true,
mfsu: true,
npmClient: 'yarn',
// headScripts: [{ src: 'https://unpkg.com/[email protected]/dist/jquery.js' }],
// scripts: [
// { content, charset: 'utf-8' },
// {
// src: process.env.NODE_ENV === 'development' ? '/js/snow.js' : `/${repo}/js/snow.js`,
// },
// ],
tailwindcss: {},
lessLoader: {
modifyVars: {
hack: `true; @import "${path.resolve('src/assets/styles/variable.less')}";`,
},
javascriptEnabled: true,
},
cssLoader: {
url: true,
},
});