feat: added watch mode to increase performance on subsequent runs #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a watch mode to the transpiler with rollup that automatically rebuilds and changes. This also only rebuilds the changed bundles. So if you for example only change a file in the frontend it only builds the frontend and if you change a file that is used by both the frontend and the webkit (like for example a shared folder) it builds both. It will also trigger a rebuild if any file that was referenced by a
constSysfsExpris changed which then only runs theconstSysfsExprplugin for a quick compile (all handled by rollup).Watch mode can be activated by just providing it the
--watchparameter like somillennium-ttc --build dev --watchBy using rollups built in watch feature it also increases the performance on subsequent runs as rollup can then use it's cache to only rebuild the changed parts.
For example "worst-case" my plugin extendium takes about
3100msfor the frontend and2000msfor the webkit in total taking5800mswith a normal dev compile. If I then change something in the frontend it then only takes1200mswhere it just compiles the frontend. If I do the same for the webkit it now only takes400msto compile. If I change something in my shared bundle it then only takes1400msto compile both down from the original5800mson first run.This makes development a lot quicker as you no longer have to keep waiting for it to build.
If you are wondering why it still takes so long. Most of the time (like 98%) is spent in the typescript plugin becaue the typescript compiler is just slow. It is possible to switch to something like esbuild or swc but then you lose type-checking in the cli which can be quite to have.