1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- // ref: https://umijs.org/config/
- export default {
- treeShaking: true,
- routes: [
- {
- path: '/',
- component: '../layouts/index',
- routes: [
- { path: '/', component: '../pages/Home' },
- { path: '/cardList', component: '../pages/CardList' }
- ]
- }
- ],
- plugins: [
- // ref: https://umijs.org/plugin/umi-plugin-react.html
- ['umi-plugin-react', {
- antd: false,
- dva: true,
- dynamicImport: false,
- dll: false,
- hd: true,
- locale: {
- default: 'zh-CN', //默认语言 zh-CN,如果 baseSeparator 设置为 _,则默认为 zh_CN
- baseNavigator: true, // 为true时,用navigator.language的值作为默认语言
- antd: true, // 是否启用antd的<LocaleProvider />
- baseSeparator: '-', // 语言默认分割符 -
- },
- routes: {
- exclude: [
- /models\//,
- /services\//,
- /model\.(t|j)sx?$/,
- /service\.(t|j)sx?$/,
- /components\//,
- ],
- },
- //CDN引入
- links: [
- { href: 'http://sp.qn.paqukeji.com/static/antd-mobile/2.3.1/antd-mobile.min.css', rel: 'stylesheet' }
- ],
- headScripts: [
- //react
- 'http://sp.qn.paqukeji.com/static/react/16.9.0/react.production.min.js',
- //react-dom
- 'http://sp.qn.paqukeji.com/static/react/16.9.0/react-dom.production.min.js',
- //antd-mobile
- 'http://sp.qn.paqukeji.com/static/antd-mobile/2.3.1/antd-mobile.min.js'
- ]
- }],
- ],
- lessLoaderOptions: {
- javascriptEnabled: true,
- },
- extraBabelPlugins: [
- ["import", { libraryName: "antd-mobile", style: true }] // `style: true` 会加载 less 文件
- ],
- proxy: {
- '/api-app': {
- target: 'http://api.starbuds.laylib.com',
- changeOrigin: true,
- //pathRewrite: { '^/server': '' },
- },
- '/api-common': {
- target: 'http://api.starbuds.laylib.com',
- changeOrigin: true,
- //pathRewrite: { '^/server': '' },
- },
- },
- hash: true,
- outputPath: './niceNum',
- externals: {
- 'react': 'React',
- 'react-dom': 'ReactDOM',
- 'antd-mobile': 'antd-mobile',
- },
- }
|