From 9867f6e6e5c6ad03b3125089175b260bb12f2128 Mon Sep 17 00:00:00 2001 From: nikogu <644506165@qq.com> Date: Wed, 25 Oct 2017 16:09:52 +0800 Subject: [PATCH] split dva from components --- .roadhogrc | 14 ++++++++++++-- package.json | 1 + src/components/EditableLinkGroup/index.js | 2 +- src/components/Exception/index.js | 2 +- src/components/PageHeader/index.js | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.roadhogrc b/.roadhogrc index 3a08204b..3449c335 100755 --- a/.roadhogrc +++ b/.roadhogrc @@ -7,7 +7,12 @@ "transform-runtime", "transform-decorators-legacy", "transform-class-properties", - ["import", { "libraryName": "antd", "style": true }] + ["import", { "libraryName": "antd", "style": true }], + ["module-resolver", { + "alias": { + "react-router": "dva/router" + } + }] ] }, "production": { @@ -15,7 +20,12 @@ "transform-runtime", "transform-decorators-legacy", "transform-class-properties", - ["import", { "libraryName": "antd", "style": true }] + ["import", { "libraryName": "antd", "style": true }], + ["module-resolver", { + "alias": { + "react-router": "dva/router" + } + }] ] } }, diff --git a/package.json b/package.json index 5b7674ad..84539dc5 100755 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "babel-jest": "^21.0.0", "babel-plugin-dva-hmr": "^0.3.2", "babel-plugin-import": "^1.2.1", + "babel-plugin-module-resolver": "^2.7.1", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-runtime": "^6.9.0", diff --git a/src/components/EditableLinkGroup/index.js b/src/components/EditableLinkGroup/index.js index c1876ab5..ba997964 100644 --- a/src/components/EditableLinkGroup/index.js +++ b/src/components/EditableLinkGroup/index.js @@ -1,6 +1,6 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; -import { Link } from 'dva/router'; +import { Link } from 'react-router'; import { Button, Icon } from 'antd'; import styles from './index.less'; diff --git a/src/components/Exception/index.js b/src/components/Exception/index.js index 96ff430b..d6d847b9 100644 --- a/src/components/Exception/index.js +++ b/src/components/Exception/index.js @@ -1,7 +1,7 @@ import React from 'react'; import classNames from 'classnames'; import { Button } from 'antd'; -import { Link } from 'dva/router'; +import { Link } from 'react-router'; import config from './typeConfig'; import styles from './index.less'; diff --git a/src/components/PageHeader/index.js b/src/components/PageHeader/index.js index 035c7e50..97ea900d 100644 --- a/src/components/PageHeader/index.js +++ b/src/components/PageHeader/index.js @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { Breadcrumb, Tabs } from 'antd'; -import { Link } from 'dva/router'; +import { Link } from 'react-router'; import classNames from 'classnames'; import styles from './index.less'; -- GitLab