Skip to content

Commit

Permalink
Fixing svg resolution in projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Gensler committed Sep 19, 2016
1 parent 8ef549e commit 0c60955
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.js
Expand Up @@ -18,8 +18,7 @@ export default ({ types: t }) => ({
// We only support the import default specifier, so let's use that identifier:
const importIdentifier = path.node.specifiers[0].local;
const iconPath = state.file.opts.filename;
const absoluteIconPath = join(__dirname, '..', iconPath);
const svgPath = join(dirname(absoluteIconPath), path.node.source.value);
const svgPath = join(dirname(iconPath), path.node.source.value);
const svgSource = readFileSync(svgPath, 'utf8');
const optimizedSvgSource = optimize(svgSource);

Expand Down

0 comments on commit 0c60955

Please sign in to comment.