123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- // ref: https://umijs.org/config/
- import pxToViewPort from 'postcss-px-to-viewport';
- const extraPostCSSPlugins = [
- pxToViewPort({
- viewportWidth: 750,
- unitPrecision: 5,
- viewportUnit: 'vw',
- fontViewportUnit: 'vw',
- selectorBlackList: [],
- minPixelValue: 1,
- mediaQuery: true
- })
- ]
- export default {
- extraPostCSSPlugins,
- treeShaking: true,
- routes: [
- { path: '/', redirect: '/catchdolphins' },
- {
- path: '/',
- component: '../layouts/index',
- routes: [
- //抢头条活动
- { path: '/headlines', component: '../pages/Headlines', name: '抢头条' },
- { path: '/headscreen', component: '../pages/headScreen', name: '抢头条' },
- //抢海豚
- { path: '/catchdolphins', component: '../pages/Catchdolphins/Catchdolphins', name: '抢海豚' },
- //七夕活动--2021-8-14
- { path: '/loveDay', component: '../pages/Loveday/Loveday', name: '甜蜜七夕' },
- { path: '/loveDay/rule', component: '../pages/Loveday/Loverule', name: '规则说明' },
- { path: '/loveDay/list', component: '../pages/Loveday/Lovelist', name: '心动列表' },
- //中秋活动
- { path: '/middleautumn', component: '../pages/Middleautumn', name: '浓情中秋' }
- ]
- }
- ],
- plugins: [
- // ref: https://umijs.org/plugin/umi-plugin-react.html
- ['umi-plugin-react', {
- antd: false,
- dva: true,
- dynamicImport: false,
- dll: false,
- hd: {
- "theme": {
- "hd": "2px",
- },
- // "px2rem": {
- // "rootValue": 100,
- // "unitPrecision": 5,
- // "propWhiteList": [],
- // "propBlackList": [],
- // "exclude": false,
- // "selectorBlackList": [],
- // "ignoreIdentifier": false,
- // "replace": true,
- // "mediaQuery": false,
- // "minPixelValue": 0
- // }
- },
- 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\//,
- ],
- },
- publicPath: '/',
- //CDN引入
- links: [
- { href: 'http://sp.qn.panygo.com/static/antd-mobile/2.3.1/antd-mobile.min.css', rel: 'stylesheet' }
- ],
- headScripts: [
- //react
- 'http://sp.qn.panygo.com/static/react/16.9.0/react.production.min.js',
- //react-dom
- 'http://sp.qn.panygo.com/static/react/16.9.0/react-dom.production.min.js',
- //antd-mobile
- 'http://sp.qn.panygo.com/static/antd-mobile/2.3.1/antd-mobile.min.js',
- //lottie动画
- 'http://sp.qn.panygo.com/static/bodymovin/5.6.8/lottie.min.js',
- //moment
- 'http://sp.qn.panygo.com/static/moment/2.24.0/moment.min.js',
- //UAParser
- 'http://sp.qn.panygo.com/static/UAParser/0.7.21/ua-parser.min.js'
- ]
- }]
- ],
- lessLoaderOptions: {
- javascriptEnabled: true,
- },
- extraBabelPlugins: [
- ["import", { libraryName: "antd-mobile", style: true }] // `style: true` 会加载 less 文件
- ],
- proxy: {
- '/api-app': {
- // target: 'http://api.timichat.net',
- target: 'http://localhost:9201',
- changeOrigin: true,
- //pathRewrite: { '^/server': '' },
- },
- '/api-common': {
- // target: 'http://api.starbuds.laylib.com',
- target: 'http://localhost:9230',
- changeOrigin: true,
- //pathRewrite: { '^/server': '' },
- },
- },
- hash: true,
- outputPath: './srank',
- externals: {
- 'react': 'React',
- 'react-dom': 'ReactDOM',
- 'antd-mobile': 'antd-mobile',
- 'lottie-web': 'lottie',
- 'moment': 'moment',
- 'ua-parser-js': 'UAParser'
- },
- define: {
- 'process.env': process.env
- }
- }
|