MSBuild: Only transpile when file has changed #299

Closed
TorbenRahbekKoch opened this Issue Aug 8, 2016 · 2 comments

Projects

None yet

2 participants

@TorbenRahbekKoch
Contributor

Since the transpiling does take a considerable amount of time, it would be awesome if the files were only transpiled when changed (or the target file is missing).

It could be as simple as just comparing the timestamps on the original file and the generated file, or something more advanced as storing a hash for the original file. That would probably be overkill, though.

@Daniel15
Member

This is a good idea. The file actually already has a hash (see Babel.LoadFromFileCache) so the MSBuild task would just need to check the cache before transforming the file.

The best solution is probably to update Babel.TransformAndSaveFile to check the cache via LoadFromFileCache before doing the transformation. If the cached data is valid, we don't need to do the transformation.

@TorbenRahbekKoch TorbenRahbekKoch pushed a commit to TorbenRahbekKoch/React.NET that referenced this issue Sep 3, 2016
Torben Rahbek Koch Use file hash to check for file changes before transpiling (#299) 223789b
@TorbenRahbekKoch TorbenRahbekKoch pushed a commit to TorbenRahbekKoch/React.NET that referenced this issue Sep 4, 2016
Torben Rahbek Koch Add check for file hash check (#299) 36f9d1a
@Daniel15 Daniel15 added a commit that referenced this issue Sep 4, 2016
@TorbenRahbekKoch @Daniel15 TorbenRahbekKoch + Daniel15 Use file hash to check for file changes before transpiling (#299) (#313)
* Use file hash to check for file changes before transpiling (#299)

* Add .editorconfig file

* Add check for file hash check (#299)

* Remove debug File.WriteAllText from test.

* Fix erroneous comment in babel.cs
2ca1cd0
@Daniel15
Member
Daniel15 commented Sep 4, 2016

Fixed in #313, thanks @TorbenRahbekKoch!

@Daniel15 Daniel15 closed this Sep 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment