Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Commit

Permalink
rollup optimization to exclude entry points optimized out
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Apr 22, 2016
1 parent ad17437 commit 548879c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions compilers/cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ exports.CJSRequireTransformer = CJSRequireTransformer;


// convert CommonJS into System.registerDynamic
function CJSRegisterTransformer(name, deps, path, optimize, static, globals, systemGlobal) {
function CJSRegisterTransformer(name, deps, path, optimize, isStatic, globals, systemGlobal) {
this.name = name;
this.deps = deps;
this.path = path;
this.usesFilePaths = false;
this.usesRequireResolve = false;
this.optimize = optimize;
this.static = static;
this.static = isStatic;
this.globals = globals;
this.systemGlobal = systemGlobal;
return ParseTreeTransformer.call(this);
Expand Down
6 changes: 3 additions & 3 deletions lib/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function getCompileHash(load, compileOpts) {

function getEncoding(canonical, encodings) {
// dont encode system modules
if (canonical[0] == '@')
if (canonical[0] == '@' && canonical != '@dummy-entry-point')
return canonical;

// return existing encoding if present
Expand Down Expand Up @@ -219,8 +219,8 @@ function compileTree(loader, tree, traceOpts, compileOpts, outputOpts, cache) {
});
}))
.filter(function(inputEntryPoint) {
// skip conditional entry points
return !inputEntryPoint.match(/\#\:|\#\?|\#{/);
// skip conditional entry points and entry points not in the tree (eg rollup optimized out)
return !inputEntryPoint.match(/\#\:|\#\?|\#{/) && tree[inputEntryPoint];
})
})
.then(function(inputEntryPoints) {
Expand Down

0 comments on commit 548879c

Please sign in to comment.