// import px2rem from 'postcss-plugin-px2rem' const autoprefixer = require('autoprefixer') // ref: https://umijs.org/config/ export default { treeShaking: true, routes: [ { path: '/', redirect: '/myleval/home' }, { path: '/myleval/home', name: '我的等级', component: '../pages/MyLeval/MyLeval' }, { path: '/nobility', name: '贵族', component: '../layouts/BasicLayout', routes: [ { path: '/nobility/home', name: '贵族', component: '../pages/MyNobility/MyNobility' }, { path: '/nobility/explain', name: '贵族说明', component: '../pages/MyNobility/MyNobilityExplain' } ] }, { path: '/vipinfo/home', name: '会员信息', component: '../pages/VipInfo/VipInfo' }, { path: '/wallettime/home', name: '时间钱包', component: '../pages/WalletTime/WalletTime' }, { path: '/wshop', name: '星元商城', component: '../layouts/BasicLayout', routes: [ { path: '/wshop/home', name: '星元商城', component: '../pages/WalletShop/WalletShop' }, { path: '/wshop/explain', name: '星元商城', component: '../pages/WalletShop/WalletShopExplain' }, { path: '/wshop/record', name: '星元商城', component: '../pages/WalletShop/BuyRecord' }, ] }, { path: '/crRanks/home', name: '排行榜', component: '../pages/CRRanks/CoinRanks' }, { path: '/chatRoom/records', name: '房间流水', component: '../pages/CRRecords/CoinRecord' }, { path: '/giftWall', name: '礼物墙', component: '../layouts/BasicLayout', routes: [ { path: '/giftWall/home', name: '礼物墙', component: '../pages/GiftWall/GiftWall' }, { path: '/giftWall/week', name: '本周礼物', component: '../pages/GiftWall/GiftWallWeek' } ] }, { path: '/wallet', name: '钱包', component: '../layouts/BasicLayout', routes: [ { path: '/wallet/transDiamond', name: '兑换星钻', component: '../pages/TransDiamond/TransDiamond' }, { path: '/wallet/transDiamond/records', name: '兑换记录', component: '../pages/TransDiamond/TransDiamondRecords' } ] }, { path: '/login', name: '登录', component: '../pages/TestLogin/TestLogin' } ], plugins: [ // ref: https://umijs.org/plugin/umi-plugin-react.html ['umi-plugin-react', { antd: true, dva: false, dynamicImport: false, title: '', dll: false, hd: true, routes: { exclude: [ /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', //moment 'http://sp.qn.paqukeji.com/static/moment/2.24.0/moment.min.js', //UAParser 'http://sp.qn.paqukeji.com/static/UAParser/0.7.21/ua-parser.min.js' ], locale: { default: 'zh-CN', antd: true } }], ], extraPostCSSPlugins: [ autoprefixer({ flexbox: true }), // px2rem({ // rootValue: 75, // // propBlackList:['border','border-top','border-left','border-right','border-bottom','border-radius','font-size'], // 这些属性不需要转换 // selectorBlackList:['t_npx'] // }) ], hash: true, // exportStatic: { // htmlSuffix: true // }, 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': '' }, }, }, // publicPath: '/themes/default/template/h5-activity/', publicPath: '/', outputPath: './inapp', copy: [ { "from": "public", "to": "" } ], // publicPath: 'http://sp.qn.paqukeji.com/inapp/', externals: { 'react': 'React', 'react-dom': 'ReactDOM', 'antd-mobile': 'antd-mobile', 'lottie-web': 'lottie', 'moment': 'moment', 'ua-parser-js': 'UAParser' }, }