1. 根目录新建一个webpack.config.js
2. 添加
module.exports = (webpackConfig, env) => {
// 別名配置
webpackConfig.resolve.alias = {
'~': `${__dirname}/src`,
}
return webpackConfig
}
3. 引入
1. 根目录新建一个webpack.config.js
2. 添加
module.exports = (webpackConfig, env) => {
// 別名配置
webpackConfig.resolve.alias = {
'~': `${__dirname}/src`,
}
return webpackConfig
}
3. 引入