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

Conditionally adding hot-loader to coffee in addition to jsx #124

Merged
merged 1 commit into from
Jan 7, 2016

Conversation

sansthesis
Copy link
Collaborator

This addresses #123, I believe.

I say I believe because I'm having trouble testing my module via npm link. I tested it by editing the npm installed index.js in my node_modules directory.

@sansthesis
Copy link
Collaborator Author

This adds react-hot to coffee-loader and cjsx-loader entries alongside babel-loader, which was hardcoded before this pr.

@lukekarrys
Copy link
Contributor

Thanks @JasonRose! We need to figure out the best way to combine this with #65. As was mentioned in that issue (#65 (comment)) using the new babel-plugin-react-transform stuff will not work for non-babel loaders like coffee-loader. I'd personally like to keep support for react-hot-loader and the new babel transform stuff so that we can support hot reloading in as many loaders as possible, and can hopefully figure that out once I have some time to review this and #117.

@sansthesis
Copy link
Collaborator Author

Ok, I'll implement the change in my webpack.config.js and wait.

@sansthesis
Copy link
Collaborator Author

If anybody else wants hot loading for their cjsx, I added this to my webpack.config.js:

//somewhere above: var cfg = getConfig({...});

if(cfg.spec.isDev && cfg.spec.devServer.hot) {
  cfg.module.loaders.forEach(function (loader) {
    var loaders = loader.loaders || [];
    if (loaders.indexOf('coffee-loader') > -1) {
      loaders.unshift('react-hot');
    }
  });
}

lukekarrys added a commit that referenced this pull request Jan 7, 2016
Conditionally adding hot-loader to coffee in addition to jsx
@lukekarrys lukekarrys merged commit f117d1e into master Jan 7, 2016
@lukekarrys lukekarrys deleted the coffee-hot-loader branch January 7, 2016 00:27
@lukekarrys
Copy link
Contributor

Published as v6.1.0.

Also as discussed in #117 (comment), react-hot-loader will probably be removed in v7.0.0 with 6.x.y being what we point people to use if they still need to use it.

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.

2 participants