File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
packages/vite/src/plugins Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,13 @@ export function ModulePreloadPolyfillPlugin (): Plugin {
12
12
name : 'nuxt:module-preload-polyfill' ,
13
13
applyToEnvironment : environment => environment . name === 'client' ,
14
14
configResolved ( config ) {
15
- isDisabled = config . build . modulePreload === false || config . build . modulePreload . polyfill === false
16
- sourcemap = ! ! config . build . sourcemap
17
- entry = resolveClientEntry ( config )
15
+ try {
16
+ isDisabled = config . build . modulePreload === false || config . build . modulePreload . polyfill === false
17
+ sourcemap = ! ! config . build . sourcemap
18
+ entry = resolveClientEntry ( config )
19
+ } catch {
20
+ console . debug ( '[nuxt:module-preload-polyfill] Could not resolve client entry, module preload polyfill will not be injected.' )
21
+ }
18
22
} ,
19
23
transform ( code , id ) {
20
24
if ( isDisabled || id . replace ( QUERY_RE , '' ) !== entry ) { return }
Original file line number Diff line number Diff line change @@ -15,8 +15,12 @@ export function TypeCheckPlugin (nuxt: Nuxt): Plugin {
15
15
return ! nuxt . options . test && nuxt . options . typescript . typeCheck === true
16
16
} ,
17
17
configResolved ( config ) {
18
- entry = resolveClientEntry ( config )
19
- sourcemap = ! ! config . build . sourcemap
18
+ try {
19
+ entry = resolveClientEntry ( config )
20
+ sourcemap = ! ! config . build . sourcemap
21
+ } catch {
22
+ console . debug ( '[nuxt:type-check] Could not resolve client entry, type checking will not be applied.' )
23
+ }
20
24
} ,
21
25
transform ( code , id ) {
22
26
if ( id . replace ( QUERY_RE , '' ) !== entry ) { return }
You can’t perform that action at this time.
0 commit comments