Skip to content

Commit 237ba96

Browse files
committed
chore: Update babel standalone types. #94
1 parent 601b8ba commit 237ba96

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"@kkt/less-modules": "6.9.0",
4848
"@kkt/raw-modules": "6.9.0",
4949
"@kkt/scope-plugin-options": "6.9.0",
50+
"@types/babel__standalone": "7.1.3",
5051
"@types/codemirror": "5.60.0",
5152
"@types/react": "17.0.5",
5253
"@types/react-dom": "17.0.5",

Diff for: src/babel.d.ts

-6
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,3 @@
55
declare module '@babel/plugin-transform-classes' {
66
export default function _default(url: any, options: any): any;
77
}
8-
9-
declare module '@babel/standalone' {
10-
export default function _default(url: any, options: any): any;
11-
export type Transform = (code: string, options: { [key: string]: any }) => any;
12-
export const transform: Transform;
13-
}

Diff for: src/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export default class CodePreview extends React.PureComponent<CodePreviewProps, I
141141
codeStr = codeStr.replace('_mount_', `document.getElementById('${this.playerId}')`);
142142
const input = `${codeStr}`;
143143
const { code } = await BabelTransform(input);
144-
args.push(code);
144+
args.push(code || '');
145145
// eslint-disable-next-line no-new-func
146146
new Function(...args).apply(null, argv);
147147
this.setState({ errorMessage: '' });

0 commit comments

Comments
 (0)