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

Replaced fwd slashes with backslashes for win to fix sass deps watch #1602

Merged
merged 5 commits into from
Jun 30, 2018

Conversation

lysla
Copy link
Contributor

@lysla lysla commented Jun 22, 2018

Running parcel watch on Windows wouldn't re-build scss files when only partial sass dependencies, imported in the main .scss file, were modified. The reason is Windows uses forward slashes / in the path of these dependencies. #1451

@@ -65,6 +65,9 @@ class SASSAsset extends Asset {

collectDependencies() {
for (let dep of this.ast.stats.includedFiles) {
if (os.platform() === 'win32') {
Copy link
Member

@DeMoorJasper DeMoorJasper Jun 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about moving this to?
https://github.com/parcel-bundler/parcel/blob/master/src/Bundler.js#L394
and
https://github.com/parcel-bundler/parcel/blob/master/src/Bundler.js#L704

This way this applies to every asset type, not just scss.

Unfortunately, I'm not able to test, so I can't test if this would work

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you could use path.normalize for this https://nodejs.org/api/path.html#path_path_normalize_path

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just did another commit, moving the fix in Bundler.js like suggested and using path.normalize. I'm not sure I put it in the right positions, but as far as I could test it, it works. Thanks for your efforts!

@devongovett
Copy link
Member

actually I believe that since we are calling fs.realpath on the path now prior to watching it, that will cause it to be normalized already.

@devongovett devongovett merged commit 9200e9a into parcel-bundler:master Jun 30, 2018
@lysla
Copy link
Contributor Author

lysla commented Jul 1, 2018

Thank you for merging @devongovett keep up the awesome work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants