Skip to content

Commit

Permalink
fix: completeSystemWrapPlugin captures function () (fixes #9807) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Tal500 committed Aug 25, 2022
1 parent 61273b2 commit 1ee0364
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/node/plugins/completeSystemWrap.ts
Expand Up @@ -4,7 +4,7 @@ import type { Plugin } from '../plugin'
* make sure systemjs register wrap to had complete parameters in system format
*/
export function completeSystemWrapPlugin(): Plugin {
const SystemJSWrapRE = /System.register\(.*\((exports)\)/g
const SystemJSWrapRE = /System.register\(.*(\(exports\)|\(\))/g

return {
name: 'vite:force-systemjs-wrap-complete',
Expand All @@ -13,7 +13,7 @@ export function completeSystemWrapPlugin(): Plugin {
if (opts.format === 'system') {
return {
code: code.replace(SystemJSWrapRE, (s, s1) =>
s.replace(s1, 'exports, module')
s.replace(s1, '(exports, module)')
),
map: null
}
Expand Down

0 comments on commit 1ee0364

Please sign in to comment.