Skip to content

Commit

Permalink
Make the transform function (which uses @babel/standalone) compatible…
Browse files Browse the repository at this point in the history
… with vite
  • Loading branch information
NullVoxPopuli committed Nov 5, 2024
1 parent 8cf9077 commit 18e9e3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ember-repl/addon/src/compile/formats/gjs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ async function transform(
): Promise<ReturnType<Babel['transform']>> {
// @babel/standalone is a CJS module....
// so we have to use the default export (which is all the exports)
let maybeBabel = (await import('@babel/standalone')) as Babel;
let maybeBabel = (await import('@babel/standalone')) as any;
// Handle difference between vite and webpack in consuming projects...
let babel = 'default' in maybeBabel ? maybeBabel.default : maybeBabel;
let babel: Babel = 'default' in maybeBabel ? maybeBabel.default : maybeBabel;

return babel.transform(intermediate, {
filename: `${name}.js`,
Expand Down

0 comments on commit 18e9e3e

Please sign in to comment.