Skip to content

Commit

Permalink
fix: broken build when renderModernChunks=false & polyfills=false
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yle committed Sep 27, 2023
1 parent d0813b1 commit f32154f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,17 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
}

// legacy bundle
if (legacyPolyfills.size) {
if (options.polyfills !== false) {
// check if the target needs Promise polyfill because SystemJS relies on it
// https://github.com/systemjs/systemjs#ie11-support
await detectPolyfills(
`Promise.resolve(); Promise.all();`,
targets,
legacyPolyfills,
)
}

if (legacyPolyfills.size || !options.externalSystemJS) {
if (isDebug) {
console.log(
`[vite-plugin-legacy-swc] legacy polyfills:`,
Expand Down

0 comments on commit f32154f

Please sign in to comment.