Skip to content

Commit

Permalink
fix: Fix removeImports errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 11, 2022
1 parent 1934f86 commit 8861c53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/utils/transform.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { transform } from '@babel/standalone';
import { PluginItem } from '@babel/core';
import removeImports from 'babel-plugin-transform-remove-imports';
import { Options } from '../';

export function babelTransform(input: string, filename: string, opts: Options = {}) {
const plugins: PluginItem[] = [...(opts.babelPlugins || [])];
if (opts.removeImports) {
plugins.push(['babel-plugin-transform-remove-imports', opts.removeImports]);
plugins.push([removeImports, opts.removeImports]);
}
return transform(input, {
filename,
Expand Down

0 comments on commit 8861c53

Please sign in to comment.