Closed FloodGames closed 3 years ago
Webpack 5.3.0 didn't fix it.
I also notice my serviceworker.js has the same problem:
auto../assets/
Adding PublicPath fixed the manifest reference in .html and the manifest itself.
output: {
filename: "[name].[contenthash].js",
path: path.resolve("dist", "public", "scripts"), //, "scripts"
publicPath: "/",
},
Adding modifyURLPrefix fixed my serviceworker.js
new WorkboxPlugin.InjectManifest({
maximumFileSizeToCacheInBytes: 10000000, //MUSIC.bank is 7.71 MB, and won't be precached. Configure maximumFileSizeToCacheInBytes to change this limit.
swSrc: "./src/client/serviceworker/serviceworker.js", //"./public/assets/serviceworker.js", //path.resolve(__dirname, "public/assets/"),
mode: "production",
modifyURLPrefix: {
"/../<SOMETHING>/": "/static/",
},
}),
thank you! i had the same issue, and setting publicPath: "/"
also got rid of the auto/
prefix for me
The directory /auto/ is unintentionally added below to my webpack (v5.2.0) distribution.
index.html
<link rel="manifest" href="auto/manifest.webmanifest" crossorigin="use-credentials"/>
manifest.webmanifest
"src": "auto/icons/android/icon_512x512.a621029042a759e434c558ca6e5d11fe.png",
webpack config: