File tree 2 files changed +5
-9
lines changed
2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 42
42
"react" : " ^15.3.1"
43
43
},
44
44
"dependencies" : {
45
- "babel-template" : " ^6.26.0" ,
46
- "babel-traverse" : " ^6.26.0" ,
47
45
"babylon" : " ^6.18.0" ,
48
46
"lodash.isplainobject" : " ^4.0.6" ,
49
47
"resolve" : " ^1.8.1" ,
Original file line number Diff line number Diff line change 1
1
import { extname , dirname } from 'path' ;
2
2
import { readFileSync } from 'fs' ;
3
- import template from 'babel-template' ;
4
- import traverse from 'babel-traverse' ;
5
3
import { parse } from 'babylon' ;
6
4
import resolve from 'resolve' ;
7
5
@@ -10,18 +8,18 @@ import escapeBraces from './escapeBraces';
10
8
import transformSvg from './transformSvg' ;
11
9
import fileExistsWithCaseSync from './fileExistsWithCaseSync' ;
12
10
13
- const buildSvg = template ( `
11
+ let ignoreRegex ;
12
+
13
+ export default ( { template, traverse, types : t } ) => {
14
+ const buildSvg = template ( `
14
15
var SVG_NAME = function SVG_NAME(props) { return SVG_CODE; };
15
16
` ) ;
16
17
17
- const buildSvgWithDefaults = template ( `
18
+ const buildSvgWithDefaults = template ( `
18
19
var SVG_NAME = function SVG_NAME(props) { return SVG_CODE; };
19
20
SVG_NAME.defaultProps = SVG_DEFAULT_PROPS_CODE;
20
21
` ) ;
21
22
22
- let ignoreRegex ;
23
-
24
- export default ( { types : t } ) => {
25
23
function applyPlugin ( importIdentifier , importPath , path , state ) {
26
24
if ( typeof importPath !== 'string' ) {
27
25
throw new TypeError ( '`applyPlugin` `importPath` must be a string' ) ;
You can’t perform that action at this time.
0 commit comments