timecounts / parallel-transpile

Transpile files using webpack loaders in parallel using all available CPUs [abandoned] Use HappyPack instead
9 stars 2 forks source link

Recompile files whose output has been modified since last compile #7

Open benjie opened 8 years ago

benjie commented 8 years ago

Our build system has an issue wherein to version the files it modifies the files that parallel-transpile has compiled in order to reference the new, versioned, filenames.

For example if foo.jsx references image.jpg and we version image.jpg -> image.13371337.jpg; it will modify the compiled foo.js to reference image.13371337.jpg instead.

This is fine; but the next time we compile with a new image.jpg (-> image.00bada55.jpg) if foo.jsx has not been modified then it is not recompiled. The versioning system skips over the compiled foo.js because it doesn't match image.jpg any more, and the stale image.13371337.jpg reference is maintained.

This PR adds a paranoid mode to parallel-transpile where it no longer trusts the compiled code to be unmodified - it checks it with a checksum. If it has been modified, the file will be recompiled regardless.

This does not affect watch mode.