mgechev / angular2-hot-loader

[NOT MAINTAINED] Angular 2 hot loader
https://www.youtube.com/watch?v=S9pKbi3WrCM
114 stars 8 forks source link

Note that the project is in very early stage of development. It is still not ready for usage but you can give it a try and share your feedback.

Angular2 Hot Loader

Hot loader for Angular 2, inspired by react-hot-loader.

How to use?

npm install angular2-hot-loader

You can start the hot loader server by:

import * as ng2HotLoader from 'angular2-hot-loader';

ng2HotLoader.listen({
  port: 4412,
  projectRoot: __dirname
});

Somewhere inside of your templates add:

System.import('//localhost:4412/ng2-hot-loader')
  .then(module => {
    module.ng2HotLoaderBootstrap(AppCmp, [PROVIDERS]);
  });

Now you can watch your file system with any module you feel comfortable with. Once you detect a change in the target files use:

ng2HotLoader.onChange([fileName]);

Now on each edit the changes should be pushed to the client.

Roadmap

Features

Limitations

License

MIT