Skip to content
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

Watching single files broken on Windows since 4.4.0 because of wrong path separator #226

Closed
frigus02 opened this issue Feb 14, 2018 · 6 comments

Comments

@frigus02
Copy link

Since version 4.4.0 watching of single files (from is no glob and points to file) is broken on Windows. I tracked it down to this change. It changes the file path on Windows like this:

// pattern before: { absoluteFrom: 'C:\\code\\notes\\src\\sw.js' }
pattern.absoluteFrom = escape(pattern.absoluteFrom);
// pattern after: { absoluteFrom: 'C:/code\\notes\\src\\sw.js' }

The path after the change is registered as a file dependency in webpack. But since it's wrong, webpack does not notice any changes to the file.

@alexander-akait
Copy link
Member

@frigus02 can you create minimum reproducible test repo?

@frigus02
Copy link
Author

Sure, here you go: https://github.com/frigus02/test-copy-webpack-plugin-path-separator

To reproduce, clone on Windows and do:

yarn install
yarn start

Then change the file copy.txt. Webpack will not notice any changes. Try the same on Linux and it works as expected.

@vsDizzy
Copy link

vsDizzy commented Feb 21, 2018

Changed from to glob as a workaround.

@alexander-akait
Copy link
Member

@frigus02 Thanks for issue. Confirm. WIP

@alexander-akait
Copy link
Member

@frigus02 can you test branch #230?

@frigus02
Copy link
Author

Thanks @evilebottnawi. I tested the PR and can confirm that it solves the issue on Windows.

@michael-ciniawsky michael-ciniawsky removed this from the 4.4.2 milestone Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants