vue.config.js is located in the root directory
projects built with vue-cli3
const path = require("path");
function resolve(dir) {
return path.join(__dirname, dir);
}
module.exports = {
lintOnSave: true,
// sourceMap
productionSourceMap: false,
// CSS source maps?
sourceMap: false,
chainWebpack: config => {
config.resolve.alias
.set("@", resolve("src"))
.set("utils", resolve("src/utils"));
}
};
references in components
import { toggleFullscreen } from "utils/fullScreen";
error
Module not found: Error: Can"t resolve "utils/fullScreen" in "E:\Projects\***\src\components"
what should I do about this?