Answer the question
In order to leave comments, you need to log in
How to fix the generated path for the included script?
There is a config
{
mode: "development",
entry: {
"some-entry": {
import: "./src/directory/some-entry",
filename: "directory/some-entry/script/script.js"
}
},
output: {
path: path.resolve(__dirname, "dist/"),
filename: "script.js",
},
module: {},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, "./index.html"),
filename: "directory/some-entry/index.html",
inject: "body"
})
]
}
<script defer src="../../directory/some-entry/script/script.js"></script></body>
<script defer src="./script/script.js"></script></body>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question