Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSBuild: Only transpile when file has changed #299

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

MSBuild: Only transpile when file has changed #299

TorbenRahbekKoch opened this issue Aug 8, 2016 · 2 comments

Comments

@TorbenRahbekKoch
Copy link
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
Copy link
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.

Daniel15 pushed a commit that referenced this issue Sep 4, 2016
* 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
@Daniel15
Copy link
Member

Daniel15 commented Sep 4, 2016

Fixed in #313, thanks @TorbenRahbekKoch!

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

No branches or pull requests

2 participants