Skip to content

Commit

Permalink
[Refactor] no need to directly depend on babel-template or babel-trav…
Browse files Browse the repository at this point in the history
…erse
  • Loading branch information
ljharb committed Oct 9, 2018
1 parent 85ec7c3 commit 7665543
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 0 additions & 2 deletions package.json
Expand Up @@ -42,8 +42,6 @@
"react": "^15.3.1"
},
"dependencies": {
"babel-template": "^6.26.0",
"babel-traverse": "^6.26.0",
"babylon": "^6.18.0",
"lodash.isplainobject": "^4.0.6",
"resolve": "^1.8.1",
Expand Down
12 changes: 5 additions & 7 deletions src/index.js
@@ -1,7 +1,5 @@
import { extname, dirname } from 'path';
import { readFileSync } from 'fs';
import template from 'babel-template';
import traverse from 'babel-traverse';
import { parse } from 'babylon';
import resolve from 'resolve';

Expand All @@ -10,18 +8,18 @@ import escapeBraces from './escapeBraces';
import transformSvg from './transformSvg';
import fileExistsWithCaseSync from './fileExistsWithCaseSync';

const buildSvg = template(`
let ignoreRegex;

export default ({ template, traverse, types: t }) => {
const buildSvg = template(`
var SVG_NAME = function SVG_NAME(props) { return SVG_CODE; };
`);

const buildSvgWithDefaults = template(`
const buildSvgWithDefaults = template(`
var SVG_NAME = function SVG_NAME(props) { return SVG_CODE; };
SVG_NAME.defaultProps = SVG_DEFAULT_PROPS_CODE;
`);

let ignoreRegex;

export default ({ types: t }) => {
function applyPlugin(importIdentifier, importPath, path, state) {
if (typeof importPath !== 'string') {
throw new TypeError('`applyPlugin` `importPath` must be a string');
Expand Down

0 comments on commit 7665543

Please sign in to comment.