Skip to content

Commit a56245e

Browse files
authored
feat(native-plugin): use js import glob plugin in dev environment (#234)
1 parent 7246509 commit a56245e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ interface ParsedGeneralImportGlobOptions extends GeneralImportGlobOptions {
4242
}
4343

4444
export function importGlobPlugin(config: ResolvedConfig): Plugin {
45-
if (config.experimental.enableNativePlugin === true) {
45+
if (
46+
config.experimental.enableNativePlugin === true &&
47+
config.command === 'build'
48+
) {
4649
return nativeImportGlobPlugin({
4750
root: config.root,
4851
restoreQueryExtension: config.experimental.importGlobRestoreExtension,

0 commit comments

Comments
 (0)