Closed bighoho123 closed 3 years ago
In this pull request, the contributor also mentioned this
https://github.com/shellscape/webpack-manifest-plugin/pull/226#issue-516329272
This is not an issue with this plugin. See https://webpack.js.org/migrate/5/
404 errors pointing to URLs containing auto
Not all ecosystem tooling is ready for the new default automatic publicPath via output.publicPath: "auto"
Use a static output.publicPath: "" instead.
Thanks!
@shellscape what is the recommended way to deal with this then? Should we be using webpack 4 or?
@shonin read the migration guide I linked to and follow the instructions, or use v4 sure.
Not all ecosystem tooling is ready for the new default automatic publicPath
could you explain why this issue is closed, even though this plugin is still not "ready for the new default automatic publicPath"? The migration guide implies that the tooling should become ready eventually and only presents a workaround until ready. That is how I read it at least. If this plugin chooses not to support this webpack feature, imo it should at least be documented prominently.
Thx for your effort @shellscape!
Totally agree with @m10 here. I believe @shellscape misunderstood the webpack migration guide. It states the "common issues" and their possible fixes. Replacing "auto"
with ""
is not a solution in global context.
"auto"
performs caller script detection and resolves path relative to injected entrypoint path;""
(empty path) simply forces resolution, relative to current page url;What does that mean for end-user:
""
(empty path) would not work in any apps other than SPA, with blank public path;"auto"
would work in apps with routing and on top of that would allow runtime path resolution, that is used for modern multi- and microfrontend architectures.The migration guide simply pointed out that most tools are not ready for automatic public, and until they are upgraded to handle the new breaking change, the only viable solution is replacing it with "".
Thus m10 is right, with all due respect to shellscape, it's not a point of using another official suggested value. It's more of a spec incompliance, and as such must either be fixed, or documented implicitly that webpack-manifest-plugin is not going to support official publicPath: "auto"
feature. For now library consumers are forced to manually replace "auto" or use much more complicated runtime __webpack_public_path__
rebinding.
Possible workaround to keep the output.publicPath
set to "auto"
without having the "auto" prefix in the generated file is to utilize the plugin's own option publicPath
and set it to an empty string or to a desired value:
new WebpackManifestPlugin({ publicPath: "" });
Expected Behavior
Actual Behavior
Additional Information
Not sure whether this is the plugin bug or webpack bug.
Potentially I could workaround by setting plugin option, but this feels hacky