Skip to content

Commit

Permalink
Import and use ES modules' namespace object.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed Aug 30, 2018
1 parent 59ced05 commit aa98380
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/graph/treeshake.js
Expand Up @@ -116,8 +116,10 @@ function loadFromGraph(getNode) {

if(node) {
// Add deps as regular imports
for(let specifier of node.load.metadata.deps) {
code += `import "${specifier}";\n`;
for(let i = 0; i < node.load.metadata.deps.length; i++) {
let specifier = node.load.metadata.deps[i];
code += `import * as dep${i} from "${specifier}";\n`;
code += `global.someFunction(dep${i}.default);\n`;
}
}

Expand Down

0 comments on commit aa98380

Please sign in to comment.