import { defineConfig } from 'umi'; export default defineConfig({ nodeModulesTransform: { type: 'none', }, plugins: ['@alitajs/hd'], hd: { theme: {}, px2rem: { rootValue: 100, unitPrecision: 5, propWhiteList: [], propBlackList: [], exclude: false, selectorBlackList: [], ignoreIdentifier: false, replace: true, mediaQuery: true, minPixelValue: 0, }, }, extraBabelPlugins: [ ['import', { libraryName: 'antd-mobile', style: true }], // `style: true` 会加载 less 文件 ], routes: [ { path: '/', component: '@/pages/index', title: '今夜你会不会来' }, { path: '/downloadB', component: '@/pages/downloadB', title: '今夜你会不会来', }, { path: '/success', component: '@/pages/Success', title: '成功' }, { path: '/channel/center', component: '@/pages/MyInviteCenter/MyInviteCenter', title: '邀好友 赚收益', }, { path: '/channel/record', component: '@/pages/MyInviteCenter/InviteRecord', title: '邀请明细', }, { path: '/channel/banner', component: '@/pages/MyInviteCenter/Banner', title: '分享海报', }, { path: '/security', component: '@/components/Security/Security', title: '人机校验', }, { path: '/market', title: 'TiMi语音', component: '@/pages/Market.tsx', }, { path: '/promote', title: 'TiMi语音', component: '@/pages/Promote.tsx', }, ], proxy: { '/api-app': { target: 'http://api.timichat.net', //target: 'http://h5.paqukeji.com', changeOrigin: true, //pathRewrite: { '^/server': '' }, }, '/api-common': { target: 'http://api.timichat.net', //target: 'http://h5.paqukeji.com', changeOrigin: true, //pathRewrite: { '^/server': '' }, }, }, hash: true, outputPath: './iv', //CDN引入 links: [ { href: '//sp.qn.timichat.cn/static/antd-mobile/2.3.1/antd-mobile.min.css', rel: 'stylesheet', }, ], headScripts: [ //react '//sp.qn.timichat.cn/static/react/16.9.0/react.production.min.js', //react-dom '//sp.qn.timichat.cn/static/react/16.9.0/react-dom.production.min.js', //antd-mobile '//sp.qn.timichat.cn/static/antd-mobile/2.3.1/antd-mobile.min.js', ], chainWebpack(config) { config.module .rule('mp4') .test(/\.(mp4|zip)(\?.*)?$/) .use('file-loader') .loader(require.resolve('file-loader')) .options({ name: 'static/[name].[hash:8].[ext]', esModule: false, }); }, });