I have installed the project with vue cli 3
but as the project grows, the import on the components are getting ugly, I end up importing a component like
import Component from '../../../../components/folder/Component.vue'
I just want to alias the src folder and do
import Component from '@components/folder/Component.vue'
I did read that I have to modify the vue.config.js
, I have done it but the error is the same
Module not found: Error: Can't resolve '@components/Permissions/PermissionsTable'
This is my vue.config.js
const path = require("path");
const vueSrc = "./src";
module.exports = {
runtimeCompiler: true,
css: {
modules: true
},
configureWebpack: {
resolve: {
alias: {
"@": path.join(__dirname, vueSrc)
}
}
}
};
Am I missing something? What else should I do?
import Component from '@/components/folder/Component.vue'
? – Worser