// ref: https://umijs.org/config/ export default { treeShaking: true, routes: [ { path: '/full', component: '../pages/FullScreen/FullScreenHome' }, { path: '/fullWinnerList', component: '../pages/FullScreen/WinnerList' }, { path: '/fullRule', component: '../pages/FullScreen/FullRule' }, { path: '/rewardsDetail', component: '../pages/FullScreen/RewardsDetail' }, { path: '/', component: '../layouts/index', routes: [ { path: '/', component: '../pages/Home' }, // { path: '/full', component: '../pages/FullScreenHome' }, { path: '/rule', component: '../pages/Rule' }, { path: '/winnerList', component: '../pages/WinnerList' } ] }, ], plugins: [ // ref: https://umijs.org/plugin/umi-plugin-react.html ['umi-plugin-react', { antd: false, dva: true, dynamicImport: false, dll: false, hd: true, 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', //lottie动画 'http://sp.qn.paqukeji.com/static/bodymovin/5.6.8/lottie.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: './pig-h5', publicPath: 'http://sp.qn.paqukeji.com/goldPig/', externals: { 'react': 'React', 'react-dom': 'ReactDOM', 'antd-mobile': 'antd-mobile', 'lottie-web': 'lottie' }, }