Closed Waxolunist closed 3 years ago
This one had me scratching my head for a while, I found that there's an incompatibility between the way this plugin works and @rollup/plugin-typescript
I think they are doing something that caches files outside of rollup's cache, so when this plugin runs a second instance of rollup to bundle the worker files something breaks internally.
The immediate solution is to replace @rollup/plugin-typescript
for rollup-plugin-typescript2
(should be a drop-in replacement).
In the long term I'll try to get in contact with the @rollup/plugin-typescript
authors to try to figure out a long term solution.
Thanks for the report! also, kudos on the painter app!
closing for now, feel free to re-open if the issues persist.
EDIT: Also I would recommend adding chunkFileNames: '[name].js'
to config.output
to avoid generating a bunch of new files when the watch build is triggered again.
Thanks for the heads up and the tip with the chunkfilenames.
When using the plugin the watch mode is broken. My webworker is written with ts.
My config looks like this:
The watch mode executes the build, but the files generated are the same as before. The workaround currently used is this:
But the builds are only half as fast as with rollup watchmode enabled.
My repository is this: https://github.com/Waxolunist/paint2
To reproduce start the watchmode and the devserver:
When changing a file (e.g. changing the html in paint-app.ts) the changes are not written to the bundle directory. Commenting out the workerLoader plugin in rollup.config.js changes are picked up immediately, so I assume the workerLoader plugin is something doing to the cache.