build(node-runtime-worker-thread, compass-shell): Do not inline worker-runtime modules #588
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.
This PR refactors
node-runtime-worker-thread
bundling process to not inline worker source and keep the package as external/peer dependency in the bundle ofcompass-shell
. I spent some time digging into bundling of electron apps and this approach is something that I somehow completely missed as possible during the initial implementation.Benefits of this approach is a simplified build pipeline for the library itself, no need to maintain a custom webpack loader and in theory this should unblock (or definitely make much easier) the inclusion of the
interruptor
with the library eventually.Downside is a bit cumbersome way of importing worker source in the library that relies on the files staying close together in one place and the need to keep in mind that the runtime is now a peer dependency of the compass shell, but both are pretty small downsides in my opinion compared to the simplification of the whole thing.
(The PR base branch is #572 to avoid conflicts between the two if branched from master)