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

Commit

Permalink
Revert "System scoping in bundles"
Browse files Browse the repository at this point in the history
This reverts commit a47503c.
  • Loading branch information
guybedford committed Sep 22, 2015
1 parent 5cf6d0e commit 7495341
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions lib/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,22 +176,18 @@ function compileTree(loader, tree, compileOpts, outputOpts, cache) {
})
.then(function() {

// if any module in the bundle is AMD, add a "bundle" meta to the bundle
// this can be deprecated if https://github.com/systemjs/builder/issues/264 lands
if (modules.some(function(name) {
return tree[name].metadata.format == 'amd';
}))
outputs.unshift('"bundle";');

// static bundle wraps with a self-executing loader
if (compileOpts.static)
return wrapSFXOutputs(loader, tree, outputs, entryPoints, compileOpts);
else
return Promise.resolve(addPackageConfig(loader, tree, outputs, entryPoints, compileOpts))
// normal bundle wrap in System closure in case we have a different global
.then(function(outputs) {
outputs.unshift('(function(System) {');
outputs.push('})(System);');

// bundle informs:
// - builder to know this can be used in subtractions
// - loader to know to apply regex to check for transpiler runtimes
outputs.unshift('"bundle";');
return outputs;
});
return addPackageConfig(loader, tree, outputs, entryPoints, compileOpts);
})
.then(function(outputs) {
// NB also include all aliases of all entryPoints along with entryPoints
Expand Down

0 comments on commit 7495341

Please sign in to comment.