File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -8,16 +8,16 @@ export const modulePreloadPolyfillId = 'vite/modulepreload-polyfill'
8
8
const resolvedModulePreloadPolyfillId = '\0' + modulePreloadPolyfillId + '.js'
9
9
10
10
export function modulePreloadPolyfillPlugin ( config : ResolvedConfig ) : Plugin {
11
- if ( config . experimental . enableNativePlugin === true ) {
11
+ if (
12
+ config . experimental . enableNativePlugin === true &&
13
+ config . command === 'build'
14
+ ) {
12
15
return perEnvironmentPlugin (
13
16
'native:modulepreload-polyfill' ,
14
17
( environment ) => {
15
- if (
16
- config . command !== 'build' ||
17
- environment . config . consumer !== 'client'
18
- )
19
- return false
20
- return nativeModulePreloadPolyfillPlugin ( )
18
+ return nativeModulePreloadPolyfillPlugin ( {
19
+ isServer : environment . config . consumer !== 'client' ,
20
+ } )
21
21
} ,
22
22
)
23
23
}
You can’t perform that action at this time.
0 commit comments