File tree Expand file tree Collapse file tree 3 files changed +131
-112
lines changed
qwik-city/src/runtime/src
qwik/src/optimizer/src/plugins Expand file tree Collapse file tree 3 files changed +131
-112
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,6 @@ export const prefetchSymbols = (path: string) => {
45
45
if ( isBrowser ) {
46
46
path = path . endsWith ( '/' ) ? path : path + '/' ;
47
47
path = path . length > 1 && path . startsWith ( '/' ) ? path . slice ( 1 ) : path ;
48
- preload ( path ) ;
48
+ preload ( path , 0.8 ) ;
49
49
}
50
50
} ;
Original file line number Diff line number Diff line change @@ -56,8 +56,9 @@ export function convertManifestToBundleGraph(
56
56
}
57
57
// Routes etc
58
58
if ( bundleGraphAdders ) {
59
+ const combined = { ...manifest , bundles : graph } ;
59
60
for ( const adder of bundleGraphAdders ) {
60
- const result = adder ( manifest ) ;
61
+ const result = adder ( combined ) ;
61
62
if ( result ) {
62
63
Object . assign ( graph , result ) ;
63
64
}
@@ -68,7 +69,17 @@ export function convertManifestToBundleGraph(
68
69
for ( const bundleName of Object . keys ( graph ) ) {
69
70
const bundle = graph [ bundleName ] ;
70
71
const imports = bundle . imports ?. filter ( ( dep ) => graph [ dep ] ) || [ ] ;
71
- const dynamicImports = bundle . dynamicImports ?. filter ( ( dep ) => graph [ dep ] ?. symbols ) || [ ] ;
72
+ const dynamicImports =
73
+ bundle . dynamicImports ?. filter (
74
+ // we only want to include dynamic imports that belong to the app
75
+ // e.g. not all languages supported by shiki
76
+ ( dep ) =>
77
+ graph [ dep ] &&
78
+ // either there are qrls
79
+ ( graph [ dep ] . symbols ||
80
+ // or it's a dynamic import from the app source
81
+ graph [ dep ] . origins ?. some ( ( o ) => ! o . includes ( 'node_modules' ) ) )
82
+ ) || [ ] ;
72
83
73
84
/**
74
85
* Overwrite so we don't mutate the given objects. Be sure to copy all properties we use during
You can’t perform that action at this time.
0 commit comments