Skip to content

Commit cc30d98

Browse files
committed
feat: add globImport option
closes #492
1 parent 2aaad39 commit cc30d98

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/features/rolldown.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export async function resolveInputOptions(
8787
cjsDefault,
8888
banner,
8989
footer,
90+
globImport,
9091
} = config
9192

9293
const plugins: RolldownPluginOption = []
@@ -133,10 +134,10 @@ export async function resolveInputOptions(
133134
await LightningCSSPlugin({ target }),
134135
)
135136
}
136-
plugins.push(
137-
ShebangPlugin(logger, cwd, name, isMultiFormat),
138-
importGlobPlugin(),
139-
)
137+
plugins.push(ShebangPlugin(logger, cwd, name, isMultiFormat))
138+
if (globImport) {
139+
plugins.push(importGlobPlugin())
140+
}
140141
}
141142

142143
if (report && LogLevels[logger.level] >= 3 /* info */) {

src/options/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ async function resolveConfig(
207207
removeNodeProtocol,
208208
nodeProtocol,
209209
cjsDefault = true,
210+
globImport = true,
210211
} = userConfig
211212

212213
const logger = createLogger(logLevel, { customLogger, failOnWarn })
@@ -334,6 +335,7 @@ async function resolveConfig(
334335
unbundle,
335336
nodeProtocol,
336337
cjsDefault,
338+
globImport,
337339
}
338340

339341
return config

src/options/types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,13 @@ export interface Options {
422422
*/
423423
report?: boolean | ReportOptions
424424

425+
/**
426+
* `import.meta.glob` support.
427+
* @see https://vite.dev/guide/features.html#glob-import
428+
* @default true
429+
*/
430+
globImport?: boolean
431+
425432
/**
426433
* **[experimental]** Generate package exports for `package.json`.
427434
*

0 commit comments

Comments
 (0)