Answer the question
In order to leave comments, you need to log in
Why doesn't websotrm see alias from webpack?
Webpack has the following alias for images:
alias: {
assets: path.resolve(__dirname, './src/static/assets')
},
Answer the question
In order to leave comments, you need to log in
jsconfig.json at the root of the project
helps me
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
}
},
"exclude": ["node_modules", "dist"]
}
I have so. Add your alias and if needed restart WebStorm/PhpStorm
// webpack.config.js
const path = require('path');
function resolve(dir) {
return path.resolve(__dirname, dir);
}
module.exports = {
resolve: {
extensions: ['.js', '.vue', '.json', '.ts'],
alias: {
'@': resolve('src/'),
},
},
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question