From c6cf63438ef636daa057f7572a750571256ae65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?chencheng=20=28=E4=BA=91=E8=B0=A6=29?= Date: Fri, 5 Jan 2018 14:18:00 +0800 Subject: [PATCH] Migrate to roadhog@2 (#542) * migrate to roadhog@2 * config html for src/index.ejs --- .roadhogrc => .webpackrc | 5 +++-- package.json | 10 +++++----- src/index.ejs | 2 +- src/index.js | 6 +++--- 4 files changed, 12 insertions(+), 11 deletions(-) rename .roadhogrc => .webpackrc (85%) diff --git a/.roadhogrc b/.webpackrc similarity index 85% rename from .roadhogrc rename to .webpackrc index 10b47806..2aeef9d6 100755 --- a/.roadhogrc +++ b/.webpackrc @@ -1,9 +1,7 @@ { "entry": "src/index.js", "extraBabelPlugins": [ - "transform-runtime", "transform-decorators-legacy", - "transform-class-properties", ["import", { "libraryName": "antd", "libraryDirectory": "es", "style": true }] ], "env": { @@ -15,5 +13,8 @@ }, "ignoreMomentLocale": true, "theme": "./src/theme.js", + "html": { + "template": "./src/index.ejs" + }, "hash": true } diff --git a/package.json b/package.json index 3267b3dc..dd2eba3a 100755 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "private": true, "scripts": { "precommit": "npm run lint-staged", - "start": "roadhog server", - "start:no-proxy": "cross-env NO_PROXY=true roadhog server", + "start": "roadhog dev", + "start:no-proxy": "cross-env NO_PROXY=true roadhog dev", "build": "roadhog build", "site": "roadhog-api-doc static && gh-pages -d dist", "analyze": "roadhog build --analyze", @@ -21,8 +21,8 @@ }, "dependencies": { "@antv/data-set": "^0.8.0", + "@babel/polyfill": "^7.0.0-beta.36", "antd": "^3.1.0", - "babel-polyfill": "^6.26.0", "babel-runtime": "^6.9.2", "bizcharts": "^3.1.0-beta.4", "bizcharts-plugin-slider": "^2.0.1", @@ -47,7 +47,7 @@ "devDependencies": { "babel-eslint": "^8.0.1", "babel-jest": "^22.0.4", - "babel-plugin-dva-hmr": "^0.4.0", + "babel-plugin-dva-hmr": "^0.4.1", "babel-plugin-import": "^1.2.1", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-decorators-legacy": "^1.3.4", @@ -76,7 +76,7 @@ "pro-download": "^1.0.0", "react-test-renderer": "^16.0.0", "redbox-react": "^1.3.2", - "roadhog": "^1.3.1", + "roadhog": "^2.0.0-0", "roadhog-api-doc": "^0.3.3", "rollbar": "^2.3.1", "stylelint": "^8.1.0", diff --git a/src/index.ejs b/src/index.ejs index 586f62e8..fc8bf98d 100644 --- a/src/index.ejs +++ b/src/index.ejs @@ -13,4 +13,4 @@
- \ No newline at end of file + diff --git a/src/index.js b/src/index.js index ea22cc02..f1a55e95 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,4 @@ -import 'babel-polyfill'; +import '@babel/polyfill'; import dva from 'dva'; import 'moment/locale/zh-cn'; import FastClick from 'fastclick'; @@ -17,10 +17,10 @@ const app = dva({ // app.use({}); // 3. Register global model -app.model(require('./models/global')); +app.model(require('./models/global').default); // 4. Router -app.router(require('./router')); +app.router(require('./router').default); // 5. Start app.start('#root'); -- GitLab