Skip to content

Latest commit

 

History

History
 
 

node-modules-hot

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

node-modules-hot

WIP to help develop local node_modules in a Meteor project.

The problem

  1. Local node modules have their own babel setup.
  2. To dev, you need to:
  3. Save src file
  4. Run npm run compile
  5. Restart Meteor
  6. That's a pain, so instead, on save, we:
  7. Run package's babel with it's babel config for just the changed file
  8. Hotload the changed output file back into Meteor for HMR
  9. Everything is still rebuilt so a full restart works too.

Assumptions

  1. Specific package structure:
  2. local babel installed as a devDependency for the package
  3. src (input) and lib (output) directories
  4. npm run compile has been run at least once before so the output paths all already exist.

In general you want a layout like http://jamesknelson.com/writing-npm-packages-with-es6-using-the-babel-6-cli/ but using a .babelrc instead of specifying options on the script command line.

See also https://github.com/gadicc/meteor-hmr/blob/master/docs/Node_Modules_Hot.md.