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

JSX Compilation Breaks Hot Reloading #1

Open
jeremyjh opened this issue Jun 18, 2017 · 0 comments
Open

JSX Compilation Breaks Hot Reloading #1

jeremyjh opened this issue Jun 18, 2017 · 0 comments

Comments

@jeremyjh
Copy link

I followed your steps to add react to a 1.3 project, but found that hot loading was not working correctly when I modified jsx components. Saving a JSX would trigger a refresh, but nothing would change until the next refresh, so I'd always be looking at something one change behind.

I found the reason is because brunch is compiling the JSX file to priv/static e.g. I'll see in the console: assets/js/components/hello.jsx -> priv/static/js/components/hello.js

This triggers a reload; at the same time app.js is getting rebuilt but it does not get a second refresh.

As a workaround (fix) I modified my config/dev.exs so that I only watch app.js itself for reloading javascript. I'm not sure that is the best solution but its working for me right now so thought I'd leave it here for anyone else who hits the same problem.

  live_reload: [
    patterns: [
      ~r{priv/static/js/app.js},
      ~r{priv/static/.*(css|png|jpeg|jpg|gif|svg)$},
...
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

1 participant