File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -9,16 +9,13 @@ export async function BabelTransform(input: string) {
99 return {
1010 name : 'transform-remove-all-import' ,
1111 visitor : {
12- // https://babeljs.io/docs/en/babel-types#importspecifier
13- ImportSpecifier ( local : any ) {
14- if ( local . parent && local . parent . source && local . parent . source . extra . rawValue ) {
15- if ( local . parent . specifiers ) {
16- local . parent . specifiers . forEach ( ( item : any ) => {
17- specifiers . push ( item . imported . name ) ;
18- } ) ;
19- }
20- local . parentPath . remove ( ) ;
21- }
12+ /**
13+ * https://babeljs.io/docs/en/babel-types#importdeclaration
14+ * @param specifiers
15+ * @param source
16+ */
17+ ImportDeclaration ( specifiers : any , source : string ) {
18+ specifiers . remove ( ) ;
2219 } ,
2320 } ,
2421 } ;
You can’t perform that action at this time.
0 commit comments