Skip to content

Commit

Permalink
Merge pull request #5 from k-yle/systemjs-missing
Browse files Browse the repository at this point in the history
fix: broken build when renderModernChunks=false & polyfills=false
  • Loading branch information
CyanSalt authored Oct 7, 2023
2 parents d0813b1 + f32154f commit a11983b
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 a11983b

Please sign in to comment.