123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- 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,
- });
- },
- });
|