Skip to content

Commit 7b40cb6

Browse files
committed
wip: fix define/modulePreloadPolyfill plugin
1 parent 843abde commit 7b40cb6

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

packages/vite/src/node/plugins/define.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export function definePlugin(config: ResolvedConfig): Plugin {
118118
return pattern
119119
}
120120

121-
if (config.experimental.enableNativePlugin === true && isBuild) {
121+
if (config.experimental.enableNativePlugin === true && isBundled) {
122122
return {
123123
name: 'vite:define',
124124
options(option) {

packages/vite/src/node/plugins/modulePreloadPolyfill.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ export const modulePreloadPolyfillId = 'vite/modulepreload-polyfill'
88
const resolvedModulePreloadPolyfillId = '\0' + modulePreloadPolyfillId + '.js'
99

1010
export function modulePreloadPolyfillPlugin(config: ResolvedConfig): Plugin {
11-
if (
12-
config.experimental.enableNativePlugin === true &&
13-
config.command === 'build'
14-
) {
11+
if (config.experimental.enableNativePlugin === true && config.isBundled) {
1512
return perEnvironmentPlugin(
1613
'native:modulepreload-polyfill',
1714
(environment) => {

0 commit comments

Comments
 (0)