Skip to content

Commit 33b2062

Browse files
committed
chore: enable format iife
1 parent 72c90f1 commit 33b2062

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
/**
@@ -1162,7 +1162,7 @@ const relativeUrlMechanisms: Record<
11621162
getResolveUrl(
11631163
`'${escapeId(partialEncodeURIPath(relativePath))}', import.meta.url`,
11641164
),
1165-
// iife: (relativePath) => getRelativeUrlFromDocument(relativePath),
1165+
iife: (relativePath) => getRelativeUrlFromDocument(relativePath),
11661166
// // NOTE: make sure rollup generate `module` params
11671167
// system: (relativePath) =>
11681168
// getResolveUrl(
@@ -1234,7 +1234,7 @@ export function createToImportMetaURLBasedRelativeRuntime(
12341234
format: InternalModuleFormat,
12351235
isWorker: boolean,
12361236
): (filename: string, importer: string) => { runtime: string } {
1237-
const formatLong = /* isWorker && format === 'iife' ? 'worker-iife' : */ format
1237+
const formatLong = isWorker && format === 'iife' ? 'worker-iife' : format
12381238
const toRelativePath = customRelativeUrlMechanisms[formatLong]
12391239
return (filename, importer) => ({
12401240
runtime: toRelativePath(

0 commit comments

Comments
 (0)