Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
Only remove export source if it belongs to Lodash. [closes #53]
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed May 4, 2016
1 parent 99eee01 commit 62c4328
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export default function({ 'types': types }) {
const { file } = path.hub;
const { node } = path;
const { value: pkgId } = node.source;

const pkgStore = store.get(pkgId);

if (!pkgStore) {
return;
}
Expand Down Expand Up @@ -168,13 +168,13 @@ export default function({ 'types': types }) {
ExportNamedDeclaration(path) {
const { node } = path;
const { file } = path.hub;

const pkgId = _.get(node, 'source.value');
const pkgStore = store.get(pkgId);
const importBase = getImportBase(pkgStore);

node.source = null;

if (pkgStore) {
node.source = null;
}
_.each(node.specifiers, spec => {
const localName = spec.local.name;
spec.local = pkgStore
Expand Down

0 comments on commit 62c4328

Please sign in to comment.