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

Webpack watch isn't working on Windows for nested imports #102

Closed
gabrielenosso opened this issue May 21, 2015 · 15 comments
Closed

Webpack watch isn't working on Windows for nested imports #102

gabrielenosso opened this issue May 21, 2015 · 15 comments

Comments

@gabrielenosso
Copy link

Hi guys,
I created a repository in which you can check the bug: https://github.com/gabrielenosso/sass-loader-watch-problem .

I have a .js file which requires just one main SASS file: ./style.scss.
This file imports the file ./classes/button.scss.
The button.scss file imports another file: ./partials/_button.scss.

Practically, if you run the webpack dev server in hot mode (just executing "npm start"), it automatically reloads if you save the "style.scss" file (root of scss) or the ./classes/button.scss file (1st level of @import), but it doesn't reload if you save the ./partials/_button.scss file (2nd level of import).

It only happens on Windows. Could it be a bug related to '' and '/' used for paths differently in Mac and Win? Or do you have any clue?

@jhnns
Copy link
Member

jhnns commented Jun 5, 2015

Mhmm I don't have a working Windows setup to reproduce the error. Would be great if you could give me some insight. The sass-loader is not a huge project, so it should be fairly understandable.

This is the line that makes the included file known to webpack.

@newtonianb
Copy link

Just hit the exact same scernario/problem! Windows 8.1 definitely a bug
@jhnns @gabrielenosso

@jorrit
Copy link
Contributor

jorrit commented Jul 19, 2015

Which Windows version do you use @gabrielenosso?

@gabrielenosso
Copy link
Author

Windows 7, so it doesn't seem to be related to a particular version of Windows...

@newtonianb
Copy link

This is a huge problem, it seems also when ran through webpack-dev-server it can't even do past one level imports, the changes in imports don't trigger a webpack-dev-server change, I'm assuming it's related. Could someone please find a way to fix this, right now it's just unusable

@jhnns
Copy link
Member

jhnns commented Jul 27, 2015

Do you use npm link or bower link?

@newtonianb
Copy link

Hi, not that I know of no

@strayiker
Copy link

// When files have been imported via the includePaths-option, these files need to be
// introduced to webpack in order to make them watchable.
function addIncludedFilesToWebpack(includedFiles) {
    includedFiles.forEach(function(filename) {
        self.dependency(path.normalize(filename));
    });
}

i add path.normalize() for dependencies and it works )
before: c:/repo/project
after: c:\repo\project

I hope it will help in solving the problem

@newtonianb
Copy link

Thank you @strayiker ! I do recall other gulp scripts having issues on windows due to paths. Where exactly do you put this function and make use of it?

@strayiker
Copy link

@f0def
Copy link

f0def commented Jul 30, 2015

Thank you @strayiker, it helped me

@davidgilbertson
Copy link

Nice one @strayiker

@jhnns
Copy link
Member

jhnns commented Aug 5, 2015

Will be fixed with the next major version. You can already test the master branch.

@newtonianb
Copy link

Thanks alot! Just curiosity when is the next major version planned for?

@jhnns
Copy link
Member

jhnns commented Aug 6, 2015

Fixed with 2.0.0

@jhnns jhnns closed this as completed Aug 6, 2015
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

No branches or pull requests

7 participants