forked from Gitlink/forgeplus-react
75 lines
2.2 KiB
TypeScript
Executable File
75 lines
2.2 KiB
TypeScript
Executable File
import { defineConfig } from 'umi'
|
||
import routes from './config/routes/index'
|
||
import publicPath from './config/publicPath'
|
||
import chainWebpack from './config/chainWebpack'
|
||
import proxy from './config/proxy'
|
||
|
||
export default defineConfig({
|
||
proxy,
|
||
publicPath: publicPath,
|
||
esbuild: {},
|
||
// externals: {
|
||
// 'react': 'window.React',
|
||
// 'react-dom': 'window.ReactDOM',
|
||
// 'hls.js':"window.Hls",
|
||
// 'echarts':"window.echarts"
|
||
// },
|
||
|
||
// // 引入被 external 库的 scripts
|
||
// // 区分 development 和 production,使用不同的产物
|
||
// scripts: process.env.NODE_ENV === 'development' ? [
|
||
// 'https://gw.alipayobjects.com/os/lib/react/16.13.1/umd/react.development.js',
|
||
// 'https://gw.alipayobjects.com/os/lib/react-dom/16.13.1/umd/react-dom.development.js',
|
||
// 'https://unpkg.com/hls.js@1.1.1/dist/hls.min.js',
|
||
// 'https://unpkg.com/echarts@5.2.2/dist/echarts.js'
|
||
// ] : [
|
||
// 'https://gw.alipayobjects.com/os/lib/react/16.13.1/umd/react.production.min.js',
|
||
// 'https://gw.alipayobjects.com/os/lib/react-dom/16.13.1/umd/react-dom.production.min.js',
|
||
// 'https://unpkg.com/hls.js@1.1.1/dist/hls.min.js',
|
||
// 'https://unpkg.com/echarts@5.2.2/dist/echarts.js'
|
||
// ],
|
||
antd: {
|
||
compact: true,
|
||
},
|
||
targets: {
|
||
ie: 11,
|
||
chrome: 79,
|
||
firefox: false,
|
||
safari: false,
|
||
edge: false,
|
||
ios: false,
|
||
}
|
||
,
|
||
dva: {
|
||
immer: true,
|
||
hmr: true,
|
||
},
|
||
nodeModulesTransform: {
|
||
type: 'none',
|
||
exclude: []
|
||
// exclude: process.env.API_ENV === 'dev' ? [] : ['react','umi','antd','codemirror','diff-match-patch','code-prettify','ali-oss','xterm','xterm-addon-fit','monaco-editor','monaco-editor-webpack-plugin','echarts','echarts-for-react','html2pdf','react-dom','react-cropper','react-beautiful-dnd','katex'],
|
||
},
|
||
dynamicImport: {
|
||
loading: '@/layouts/Loading',
|
||
},
|
||
ignoreMomentLocale: true,
|
||
hash: true,
|
||
title: "GitLink",
|
||
routes,
|
||
locale: {
|
||
default: "zh-CN",
|
||
antd: true
|
||
},
|
||
chunks: [ 'umi'],
|
||
// analyze: {
|
||
// analyzerMode: 'server',
|
||
// analyzerPort: 8888,
|
||
// openAnalyzer: true,
|
||
// generateStatsFile: false,
|
||
// statsFilename: 'stats.json',
|
||
// logLevel: 'info',
|
||
// defaultSizes: 'parsed', // stat // gzip
|
||
// },
|
||
chainWebpack,
|
||
})
|