We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
该选项用来改变模块是怎么被解析的
module.exports = { //... resolve: { // configuration options } }
创建别名让导入某些模块更加简短(相当于一个字符串变量,编译时替换)
const path = require('path'); module.exports = { //... resolve: { alias: { 'Util': path.resolve(__dirname, 'src/utilities/') } } };
原来的导入
import Utility from '../../utilities/utility';
可以简单用以下表示,注意路径
import Utility from 'Util/utility';
The text was updated successfully, but these errors were encountered:
No branches or pull requests
配置之 Resolve
该选项用来改变模块是怎么被解析的
resolve.alias
创建别名让导入某些模块更加简短(相当于一个字符串变量,编译时替换)
原来的导入
可以简单用以下表示,注意路径
The text was updated successfully, but these errors were encountered: