I have set my configureWebpack parameter as below in config.js
configureWebpack: {
resolve: {
alias: {
'alias': '/easym/imgs/'
}
}
},
My folder structure is as below
-/easym
--/.vuepress
--/imgs
---/Img1.jpeg
Now when I try to call using this alias ![Img1](~@alias/Img1.jpeg)
I defined, I am getting an error
Module not found: Error: Can't resolve '@alias/Img1.jpeg' in '/home/user/git/easym/quiz/smallquizzes'
P.S- My image file is located at /easym/imgs/Img1.jpeg
where /easym
is my root folder
I found the issue related to the folder's path but using the following got it fixed.
const path = require('path')
module.exports = {
configureWebpack: {
resolve: {
alias: {
'@myassets': path.resolve(__dirname, 'assets/img')
}
}
},
...