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

Commit

Permalink
all externals to act as build: false
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jan 18, 2016
1 parent 496498a commit 6e24a78
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/trace.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,14 @@ Trace.prototype.getLoadRecord = function(canonical, excludeURLs, parentStack) {
var metadata = {};
return Promise.resolve(loader.locate({ name: normalized.replace(interpolationRegEx, '*'), metadata: metadata }))
.then(function(address) {
if (address.substr(0, 8) != 'file:///')
metadata.build = false;

// allow build: false trace opt-out
if (metadata.build === false)
return false;

// glob the conditional interpolation variations from the filesystem
if (address.substr(0, 8) != 'file:///')
throw new Error('Error tracing ' + canonical + '. It is only possible to trace conditional interpolation for modules resolving to local file:/// URLs during the build.');

var globIndex = address.indexOf('*');
return asp(glob)(fromFileURL(address), { dot: true, nobrace: true, noglobstar: true, noext: true, nodir: true })
.then(function(paths) {
Expand Down Expand Up @@ -332,6 +332,9 @@ Trace.prototype.getLoadRecord = function(canonical, excludeURLs, parentStack) {
.then(function(address) {
curHook = '';

if (address.substr(0, 8) != 'file:///')
load.metadata.build = false;

// build: false build config - null load record
if (load.metadata.build === false)
return false;
Expand Down

0 comments on commit 6e24a78

Please sign in to comment.