montagejs / mop

Montage Optimizer (mop): Minifies (to reduce file size) and creates bundles (to reduce the number of requests) of Montage applications.
Other
31 stars 16 forks source link

Add watch mode to mop #89

Open cdebost opened 5 years ago

cdebost commented 5 years ago

Adds a -w/--watch flag to the CLI and watch option to the config that causes mop to watch the specified location for file changes and recompiles automatically.

Files that are ignored by the app's .gitignore do not trigger recompilation, nor changes to the build directory.

The purpose of this PR is a first step towards eventually introducing a very fast mandatory build step to montage, like every other frontend framework. That will reduce the complexity of mr and make the transition to webpack much easier.

Currently this watch mode recompiles everything whenever a file changes. It should be smarter and keep a cache of compiled packages and only recompile what needs to be recompiled.

Depends on #76.