benmerckx / genes

Generates split ES6 modules and Typescript definitions from Haxe modules.
44 stars 8 forks source link

Don't rewrite a js file if unchanged #21

Closed kevinresol closed 4 years ago

kevinresol commented 4 years ago

Otherwise it will trigger hot-reload like hell... I think it might be an opt-in

benmerckx commented 4 years ago

Do you use the compilation server? This should take care of that: https://github.com/benmerckx/genes/blob/master/src/genes/Generator.hx#L133 I do have to rewrite the entry file every time since haxe clears it on every compilation. Or are you suggesting reading out the destination file content and not writing if body equals?

kevinresol commented 4 years ago

argh I don't use compilation server... but yes, don't rewrite a js file if there is no change

benmerckx commented 4 years ago

Should test a little more to see if this is a sensible default, added a define for now

benmerckx commented 4 years ago

But, FYI, using the compilation server makes a pretty big difference after inital compile for compilation time