Skip to content

Commit 1232be9

Browse files
committed
chore: enable format iife
1 parent d84e01b commit 1232be9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/vite/src/node/build.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export interface LibraryOptions {
271271
fileName?: string | ((format: ModuleFormat, entryName: string) => string)
272272
}
273273

274-
export type LibraryFormats = 'es' | 'cjs' /*| 'umd' | 'iife' | 'system'*/
274+
export type LibraryFormats = 'es' | 'cjs' | 'iife' /*| 'umd' | 'system'*/
275275

276276
export interface ModulePreloadOptions {
277277
/**
@@ -1164,7 +1164,7 @@ const relativeUrlMechanisms: Record<
11641164
getResolveUrl(
11651165
`'${escapeId(partialEncodeURIPath(relativePath))}', import.meta.url`,
11661166
),
1167-
// iife: (relativePath) => getRelativeUrlFromDocument(relativePath),
1167+
iife: (relativePath) => getRelativeUrlFromDocument(relativePath),
11681168
// // NOTE: make sure rollup generate `module` params
11691169
// system: (relativePath) =>
11701170
// getResolveUrl(
@@ -1236,7 +1236,7 @@ export function createToImportMetaURLBasedRelativeRuntime(
12361236
format: InternalModuleFormat,
12371237
isWorker: boolean,
12381238
): (filename: string, importer: string) => { runtime: string } {
1239-
const formatLong = /* isWorker && format === 'iife' ? 'worker-iife' : */ format
1239+
const formatLong = isWorker && format === 'iife' ? 'worker-iife' : format
12401240
const toRelativePath = customRelativeUrlMechanisms[formatLong]
12411241
return (filename, importer) => ({
12421242
runtime: toRelativePath(

0 commit comments

Comments
 (0)