Ant-design-pro: 2.0 路径别名问题

Created on 5 Sep 2018  ·  4Comments  ·  Source: ant-design/ant-design-pro

开发工具:IntelliJ IDEA
升级到2.0后出现了如下问题
20180905144047
虽然项目正常运行但是无法智能引用方法,对开发造成一定困扰,请问是否有什么插件?
麻烦告知

Most helpful comment

@sorrycc 已经解决,完整代码如下:

```js
const path = require('path');

module.exports = {
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'umi': path.resolve(__dirname, 'umi'),
},
}
};
````

参考:https://www.jetbrains.com/help/webstorm/using-webpack.html

All 4 comments

Translation of this issue:


2.0 Path alias problem

Development Tools: IntelliJ IDEA
After upgrading to 2.0, the following problems occurred.
20180905144047
Although the project is running normally but cannot be intelligently referenced, it is a problem for development. Is there any plugin?
Trouble telling

vscode有,IntelliJ IDEA 就不是很了解了

根目录新建 webpack.config.js,内容如下:

module.exports = {
  resolve: {
    alias: { '@': 'src' }
  }
}

@sorrycc 已经解决,完整代码如下:

```js
const path = require('path');

module.exports = {
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'umi': path.resolve(__dirname, 'umi'),
},
}
};
````

参考:https://www.jetbrains.com/help/webstorm/using-webpack.html

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gaoqiang19514 picture gaoqiang19514  ·  3Comments

suifan picture suifan  ·  3Comments

cheung1111 picture cheung1111  ·  3Comments

2uncle-code picture 2uncle-code  ·  3Comments

skyFi picture skyFi  ·  3Comments