Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
fix: dynamic import babel to external
Browse files Browse the repository at this point in the history
  • Loading branch information
eyworldwide committed Nov 10, 2022
1 parent 0501742 commit 24d6d42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/components/Example/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'regenerator-runtime/runtime';
import { fetchEngineDataConfig } from '../../utils';
import { AppContext } from '../contextProvider';
import { fetchDocDataById } from '../doc/util/docUtil';
import * as Babel from '@babel/standalone';

const useScript = async (libs: any) => {
const promises: Promise<any>[] = [];
Expand Down Expand Up @@ -68,8 +69,6 @@ const transformTsToJs = async (ts: string, packageGlobals: PackageGlobals) => {
return '';
}

const Babel = await import('@babel/standalone');

var output = Babel.transform(ts, {
presets: [
[
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default ({ mode }) => {
antd: ['antd'],
'oasis-engine': ['oasis-engine'],
'@oasis-engine/spine': ['@oasis-engine/spine'],
'@babel/standalone': ['@babel/standalone']
}
}
}
Expand Down

0 comments on commit 24d6d42

Please sign in to comment.