Skip to content

Commit

Permalink
chore: Update babel standalone types. #94
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 15, 2021
1 parent 601b8ba commit 237ba96
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -47,6 +47,7 @@
"@kkt/less-modules": "6.9.0",
"@kkt/raw-modules": "6.9.0",
"@kkt/scope-plugin-options": "6.9.0",
"@types/babel__standalone": "7.1.3",
"@types/codemirror": "5.60.0",
"@types/react": "17.0.5",
"@types/react-dom": "17.0.5",
Expand Down
6 changes: 0 additions & 6 deletions src/babel.d.ts
Expand Up @@ -5,9 +5,3 @@
declare module '@babel/plugin-transform-classes' {
export default function _default(url: any, options: any): any;
}

declare module '@babel/standalone' {
export default function _default(url: any, options: any): any;
export type Transform = (code: string, options: { [key: string]: any }) => any;
export const transform: Transform;
}
2 changes: 1 addition & 1 deletion src/index.tsx
Expand Up @@ -141,7 +141,7 @@ export default class CodePreview extends React.PureComponent<CodePreviewProps, I
codeStr = codeStr.replace('_mount_', `document.getElementById('${this.playerId}')`);
const input = `${codeStr}`;
const { code } = await BabelTransform(input);
args.push(code);
args.push(code || '');
// eslint-disable-next-line no-new-func
new Function(...args).apply(null, argv);
this.setState({ errorMessage: '' });
Expand Down

1 comment on commit 237ba96

@vercel
Copy link

@vercel vercel bot commented on 237ba96 May 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.