Skip to content

Commit

Permalink
Remove runtime conditions for lazy bundling
Browse files Browse the repository at this point in the history
  • Loading branch information
marcins committed Jul 23, 2023
1 parent da511c2 commit a36a37d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/runtimes/js/src/JSRuntime.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,7 @@ function getLoaderRuntime({
// Also do this when building lazily or the runtime itself could get deduplicated and only
// exist in the parent. This causes errors if an old version of the parent without the runtime
// is already loaded.
if (
bundle.env.outputFormat === 'commonjs' ||
bundle.env.isLibrary ||
options.shouldBuildLazily
) {
if (bundle.env.outputFormat === 'commonjs' || bundle.env.isLibrary) {
externalBundles = [mainBundle];
} else {
// Otherwise, load the bundle group entry after the others.
Expand Down Expand Up @@ -417,7 +413,7 @@ function getLoaderRuntime({
})
.filter(Boolean);

if (bundle.env.context === 'browser' && !options.shouldBuildLazily) {
if (bundle.env.context === 'browser') {
loaderModules.push(
...externalBundles
// TODO: Allow css to preload resources as well
Expand Down

0 comments on commit a36a37d

Please sign in to comment.