From 5c2df04b5e26f6cdc2536ed8b02b1ba1603cb879 Mon Sep 17 00:00:00 2001 From: chencheng Date: Thu, 19 Jul 2018 16:57:22 +0800 Subject: [PATCH] migrate to umi@2-beta --- config/config.js | 22 +++++++++++----------- package.json | 9 +++------ src/pages/document.ejs | 6 ++---- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/config/config.js b/config/config.js index 87469d16..54fbd48f 100644 --- a/config/config.js +++ b/config/config.js @@ -7,8 +7,17 @@ const path = require('path'); export default { // add for transfer to umi plugins: [ - 'umi-plugin-dva', - 'umi-plugin-locale', + [ + 'umi-plugin-react', + { + dva: true, + antd: true, + locale: { + default: 'zh-CN', // default zh-CN + baseNavigator: true, // default true, when it is true, will use `navigator.language` overwrite default + }, + }, + ], // TODO 决定是否使用约定路由,如果使用配置路由那么 umi-plugin-routes 可以去掉了 // [ // 'umi-plugin-routes', @@ -20,20 +29,12 @@ export default { // }, // ], ], - 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 - antd: true, // use antd, default is true - }, // 路由配置 routes: pageRoutes, theme: { 'card-actions-background': '#f5f8fa', }, - // entry: 'src/index.js', // TODO remove - extraBabelPlugins: [['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }]], env: { development: { extraBabelPlugins: ['dva-hmr'], @@ -70,7 +71,6 @@ export default { return `antd-pro${arr.join('-')}-${localName}`.replace(/--/g, '-'); }, }, - disableFastClick: true, manifest: { name: 'ant-design-pro', background_color: '#FFF', diff --git a/package.json b/package.json index 70858060..1f1882ae 100755 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "react-fittext": "^1.0.0", "rollbar": "^2.4.2", "setprototypeof": "^1.1.0", + "umi-plugin-react": "^1.0.0-beta.1", "url-polyfill": "^1.0.13" }, "devDependencies": { @@ -54,7 +55,6 @@ "antd-theme-webpack-plugin": "^1.0.8", "babel-eslint": "^8.2.6", "babel-plugin-dva-hmr": "^0.4.1", - "babel-plugin-import": "^1.8.0", "babel-plugin-module-resolver": "^3.1.1", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-runtime": "^6.9.2", @@ -75,8 +75,8 @@ "gh-pages": "^1.2.0", "husky": "^0.14.3", "lint-staged": "^7.2.0", - "mockjs": "^1.0.1-beta3", "merge-umi-mock-data": "^0.0.2", + "mockjs": "^1.0.1-beta3", "prettier": "1.13.7", "pro-download": "^1.0.1", "redbox-react": "^1.5.0", @@ -84,10 +84,7 @@ "stylelint": "^9.2.1", "stylelint-config-prettier": "^3.0.4", "stylelint-config-standard": "^18.0.0", - "umi": "^1.3.15", - "umi-plugin-dva": "^0.9.1", - "umi-plugin-routes": "^0.1.5", - "umi-plugin-locale": "^1.0.1" + "umi": "^2.0.0-beta.1" }, "optionalDependencies": { "puppeteer": "^1.6.0" diff --git a/src/pages/document.ejs b/src/pages/document.ejs index 4fe33973..2100c3eb 100644 --- a/src/pages/document.ejs +++ b/src/pages/document.ejs @@ -6,11 +6,10 @@ Ant Design Pro - + - @@ -25,5 +24,4 @@ - - \ No newline at end of file + -- GitLab