Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

feat: add WatchMissingNodeModulesPlugin from react-dev-utils #259

Merged
merged 2 commits into from
Apr 5, 2017

Conversation

christophehurpeau
Copy link
Contributor

No description provided.

@christophehurpeau
Copy link
Contributor Author

@johangirod this doesn't work well...

@johangirod
Copy link
Contributor

Ok I won't merge ;)

@alepee
Copy link
Member

alepee commented Mar 21, 2017

Is this PR still active? @christophehurpeau

@christophehurpeau
Copy link
Contributor Author

@alepee you can try it and see if it works well :)

@alepee
Copy link
Member

alepee commented Mar 22, 2017

will try shortly 😃

@alepee alepee requested review from johangirod and LucasPerso March 29, 2017 13:24
@alepee
Copy link
Member

alepee commented Apr 5, 2017

This Webpack plugin ensures npm install forces a project rebuild.
We’re not sure why this isn't Webpack's default behavior.
See #186 for details.

var path = require('path');
var WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
 
// Webpack config 
module.exports = {
  // ... 
  plugins: [
    // ... 
    // If you require a missing module and then `npm install` it, you still have 
    // to restart the development server for Webpack to discover it. This plugin 
    // makes the discovery automatic so you don't have to restart. 
    // See https://github.com/facebookincubator/create-react-app/issues/186 
    new WatchMissingNodeModulesPlugin(path.resolve('node_modules'))
  ],
  // ... 
}

https://www.npmjs.com/package/react-dev-utils#new-watchmissingnodemodulespluginnodemodulespath-string

Copy link
Contributor

@LucasPerso LucasPerso left a comment

Choose a reason for hiding this comment

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

Tried it today, works like a charm.

@LucasPerso LucasPerso modified the milestone: 1.2 Apr 5, 2017
@LucasPerso LucasPerso merged commit c1206cf into master Apr 5, 2017
@LucasPerso LucasPerso deleted the react-dev-utils branch April 5, 2017 14:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants