Skip to content

Commit

Permalink
refactor(commonjs): Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Nov 19, 2020
1 parent e069045 commit 1d59b3a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion packages/commonjs/src/ast-utils.js
Expand Up @@ -69,7 +69,7 @@ export function isDefineCompiledEsm(node) {
return false;
}

export function getDefinePropertyCallName(node, targetName) {
function getDefinePropertyCallName(node, targetName) {
const targetNames = targetName.split('.');

const {
Expand Down
8 changes: 0 additions & 8 deletions packages/commonjs/src/transform-commonjs.js
Expand Up @@ -7,7 +7,6 @@ import { walk } from 'estree-walker';
import MagicString from 'magic-string';

import {
getDefinePropertyCallName,
getKeypath,
isDefineCompiledEsm,
isFalsy,
Expand Down Expand Up @@ -158,13 +157,6 @@ export default function transformCommonjs(
}
return;
}
const name = getDefinePropertyCallName(node, 'exports');
if (name) {
if (name === makeLegalIdentifier(name)) {
namedExports[name] = true;
}
return;
}
if (!isStaticRequireStatement(node, scope)) return;
if (!isDynamicRequireModulesEnabled) {
skippedNodes.add(node.callee);
Expand Down

0 comments on commit 1d59b3a

Please sign in to comment.