From 8861c53774ec734a7e97c8b83d8f8fcb991f87e0 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Wed, 11 May 2022 16:16:01 +0800 Subject: [PATCH] fix: Fix removeImports errors. --- core/src/utils/transform.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/utils/transform.ts b/core/src/utils/transform.ts index 1489cfb..317b4c8 100644 --- a/core/src/utils/transform.ts +++ b/core/src/utils/transform.ts @@ -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,