Answer the question
In order to leave comments, you need to log in
Why webpack 5 alias not working in html?
Hello. There is a webpack config. Here is a piece
entry: {
_global: ["./js/_global/_global.js"],
index: ["./js/index/#index.js"],
about: ["./js/about/#about.js"],
},
output: {
filename: "./js/[name].[contenthash].js",
path: path.resolve(__dirname, "dist"),
},
resolve: {
alias: {
"@js": path.resolve(__dirname, "src/js"),
"@scss": path.resolve(__dirname, "src/scss"),
"@": path.resolve(__dirname, "src"),
"@dist": path.resolve(__dirname, "."),
},
},
<img src="../../assets/images/_global/icons/task__volume.png" alt="eqeqe" />
<img src="[email protected]/assets/images/_global/icons/task__volume.png" alt="eqeqe" />
Answer the question
In order to leave comments, you need to log in
If I'm not mistaken they don't work in html. They only work for js
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question