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

External imports don't hot reload #9

Open
kristerkari opened this issue Jun 16, 2018 · 6 comments
Open

External imports don't hot reload #9

kristerkari opened this issue Jun 16, 2018 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kristerkari
Copy link
Owner

Files that are imported using @import do not get live reloaded.

React Native's packager does not know that the file that has changed is imported in another file, so it does not know how to reload it.

One possible fix would be to add some kind of logic that keeps track of which files are imported using @import and tell the transformer to reload the correct file.

The same issue in the Stylus transformer:
kristerkari/react-native-stylus-transformer#3

@kristerkari kristerkari added bug Something isn't working help wanted Extra attention is needed labels Jun 16, 2018
@jinookoo
Copy link

Is anything updated?
I have to restart react-native-cli
How can I solved this issues.

@kristerkari
Copy link
Owner Author

@eyu0415 Unfortunately not. The problem is that React Native's Metro packger does not know about the files that are imported with @import, so it does not watch them for changes.

@keung7251
Copy link

@kristerkari will they fix it?

@kristerkari
Copy link
Owner Author

hello @keung7251, I'm not sure if this is something than can be fixed easily, so don't expect a quick fix.

@cristianmiranda
Copy link

It'd be nice to get this fixed. Is there any way of letting Metro know about these imported SCSS files? I understand it only looks for changes in JS files, but there should be a generated JS file that corresponds to the SCSS one, right?

@kristerkari
Copy link
Owner Author

Is there any way of letting Metro know about these imported SCSS files?

Not that I know of. Of course it might be possible that there is something in Metro, but the documentation for Metro is not that great.

I understand it only looks for changes in JS files, but there should be a generated JS file that corresponds to the SCSS one, right?

The @ımports are compiled on the fly using Sass, so what Metro sees is just one .scss file since Metro has no knowledge of Sass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants