diff --git a/.roadhogrc b/.roadhogrc index 3a08204bc642335dd8f105b584d099f03ef14614..3449c335edaf7b245b045b289c9e8cb32a1f9ef2 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 5b7674adeafb1458d49b8f03c5069cac63b894e7..84539dc5b5247e851698ff465988a8fde4da8fd5 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 c1876ab5e611563de9da6b341af261cc1e13ec6a..ba99796475e4363ae8f29aeff9e0a87d9d3f9ae2 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 96ff430b73acc03884cef53a7d5f71119adcffc3..d6d847b96ebf7483a3e36bb035df56e30673dfa4 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 035c7e50036e1212034f78c1241feebf7c8bfe3d..97ea900dcd2f455fea46a4a1cf9556f497f56f2f 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';