1.在ts.config.js中添加如下代码,如果没有这个文件,在根目录创建一个
const path = require("path");
function resolve(dir) {
return path.join(__dirname, dir);
}
module.exports = {
chainWebpack: config => {
config.resolve.alias
.set("@", resolve("src"))
.set("assets", resolve("src/assets"))
.set("components", resolve("src/components"))
.set("views", resolve("src/views"))
// .set("base", resolve("baseConfig"))
// .set("public", resolve("public"));
},
}
网友评论