-
-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backslashes in asset paths in v5 (breaking change from v4) #383
Comments
Looks like a bug, PR welcome |
#378 looks like it should fix this. |
I think #389 also fixes this, so the devs will probably need to look at both and see which approach they prefer. |
/cc @jeffposnick not sure it is bug in copy-webpack-plugin
Disagree, assets path is path, not url, so i think we need normalize this on workbox plugin side. Also using
Yes, because in v4 watch doesn't work on windows, now it is works perfect |
That's surprising to hear (CC: @TheLarkInn). That assertion seems to be in conflict with the information from, e.g., the webpack docs for The value of the option is prefixed to every URL created by the runtime or loaders. Because of this the value of this option ends with / in most cases. AFAIK, there's isn't a separate field in a webpack This isn't just breaking Workbox's plugin; this is a change that appears to have led to angular/angular-cli#14593 (if not other issues as well), and at least two folks have opened PRs to go back to the previous behavior because they were also affected. I appreciate the fact that the change was made in order to ensure that |
@jeffposnick hm, yep, need investigate, will do this in near future, thanks for feedback |
Hi @evilebottnawi |
@bbortt today/tomorrow release |
@evilebottnawi friendly reminder to release |
@bbortt release will be in next couple hours |
Thank you very much! |
Expected Behavior
The paths exposed in webpack for assets copied over on Windows-based systems using
copy-webpack-plugin
v5 should use forward slashes (/
) as path separators.Asset paths in the webpack output are meant to be usable as URLs, which always use
/
as a path separator.Actual Behavior
Starting in
copy-webpack-plugin
v5, when performing a webpack build on a Windows-based system, backslashes (\
) are used as the path separator in the final asset paths passed to webpack.This creates downstream issues for other plugins that want to read the asset paths and treat them as URLs, as described in GoogleChrome/workbox#2057
This is a breaking change in behavior vs.
copy-webpack-plugin
v4.Code
How Do We Reproduce?
Use the following webpack config with a basic input filesystem—the actual contents don't really matter so much, and in this case I had a
src/index.html
andsrc/css/index.css
. Compare the output using the v4 and v5 branches ofcopy-webpack-plugin
.In v4, the build process output looks like the following, using the "correct"
/
path separators:In v5, the build process output looks like the following, using the "incorrect"
\
path separators:The text was updated successfully, but these errors were encountered: