Commit bd0e5ae1 authored by ι™ˆεΈ…'s avatar ι™ˆεΈ…

fix #2672, use APP_TYPE judge add ga

parent bc12d814
...@@ -4,46 +4,51 @@ import pageRoutes from './router.config'; ...@@ -4,46 +4,51 @@ import pageRoutes from './router.config';
import webpackPlugin from './plugin.config'; import webpackPlugin from './plugin.config';
import defaultSettings from '../src/defaultSettings'; import defaultSettings from '../src/defaultSettings';
export default { const plugins = [
// add for transfer to umi [
plugins: [ 'umi-plugin-react',
[ {
'umi-plugin-react', antd: true,
{ dva: {
antd: true, hmr: true,
dva: { },
hmr: true, targets: {
}, ie: 11,
targets: {
ie: 11,
},
locale: {
enable: true, // default false
default: 'zh-CN', // default zh-CN
baseNavigator: true, // default true, when it is true, will use `navigator.language` overwrite default
},
dynamicImport: {
loadingComponent: './components/PageLoading/index',
},
...(!process.env.TEST && os.platform() === 'darwin'
? {
dll: {
include: ['dva', 'dva/router', 'dva/saga', 'dva/fetch'],
exclude: ['@babel/runtime'],
},
hardSource: true,
}
: {}),
}, },
], locale: {
[ enable: true, // default false
'umi-plugin-ga', default: 'zh-CN', // default zh-CN
{ baseNavigator: true, // default true, when it is true, will use `navigator.language` overwrite default
code: 'UA-72788897-6',
judge: () => process.env.APP_TYPE === 'site',
}, },
], dynamicImport: {
loadingComponent: './components/PageLoading/index',
},
...(!process.env.TEST && os.platform() === 'darwin'
? {
dll: {
include: ['dva', 'dva/router', 'dva/saga', 'dva/fetch'],
exclude: ['@babel/runtime'],
},
hardSource: true,
}
: {}),
},
], ],
];
// judge add ga
if (process.env.APP_TYPE === 'site') {
plugins.push([
'umi-plugin-ga',
{
code: 'UA-72788897-6',
},
]);
}
export default {
// add for transfer to umi
plugins,
targets: { targets: {
ie: 11, ie: 11,
}, },
...@@ -95,7 +100,7 @@ export default { ...@@ -95,7 +100,7 @@ export default {
}, },
}, },
manifest: { manifest: {
basePath:"/" basePath: '/',
}, },
chainWebpack: webpackPlugin, chainWebpack: webpackPlugin,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment