Skip to content

Commit

Permalink
chore: enable format iife
Browse files Browse the repository at this point in the history
  • Loading branch information
underfin committed Jul 11, 2024
1 parent 5894423 commit 83bb1bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/vite/src/node/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export interface LibraryOptions {
fileName?: string | ((format: ModuleFormat, entryName: string) => string)
}

export type LibraryFormats = 'es' | 'cjs' /*| 'umd' | 'iife' | 'system'*/
export type LibraryFormats = 'es' | 'cjs' | 'iife' /*| 'umd' | 'system'*/

export interface ModulePreloadOptions {
/**
Expand Down Expand Up @@ -1162,7 +1162,7 @@ const relativeUrlMechanisms: Record<
getResolveUrl(
`'${escapeId(partialEncodeURIPath(relativePath))}', import.meta.url`,
),
// iife: (relativePath) => getRelativeUrlFromDocument(relativePath),
iife: (relativePath) => getRelativeUrlFromDocument(relativePath),
// // NOTE: make sure rollup generate `module` params
// system: (relativePath) =>
// getResolveUrl(
Expand Down Expand Up @@ -1234,7 +1234,7 @@ export function createToImportMetaURLBasedRelativeRuntime(
format: InternalModuleFormat,
isWorker: boolean,
): (filename: string, importer: string) => { runtime: string } {
const formatLong = /* isWorker && format === 'iife' ? 'worker-iife' : */ format
const formatLong = isWorker && format === 'iife' ? 'worker-iife' : format
const toRelativePath = customRelativeUrlMechanisms[formatLong]
return (filename, importer) => ({
runtime: toRelativePath(
Expand Down

0 comments on commit 83bb1bb

Please sign in to comment.