-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multiple fixes to the steal-tool's bundle
- Provide graph filter options through glob patterns - Allow user to set bundle destination folder - Prevent bundle to create a steal.production.js file - Fix CSS development bundle generation
- Loading branch information
Manuel Mujica
committed
Feb 17, 2017
1 parent
a225f52
commit 0b98e16
Showing
8 changed files
with
202 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,43 @@ | ||
var _ = require("lodash"); | ||
var through = require("through2"); | ||
var bundleFilename = require("./filename"); | ||
var concatSource = require("../bundle/concat_source"); | ||
var normalizeSource = require("./normalize_source"); | ||
var through = require("through2"); | ||
|
||
module.exports = function(){ | ||
return through.obj(function(data, enc, next){ | ||
var bundles = data.bundles; | ||
var configuration = data.configuration; | ||
var bundlesDir = configuration.bundlesPath + "/"; | ||
return through.obj(function(data, enc, next) { | ||
try { | ||
var result = concat(data); | ||
next(null, result); | ||
} catch(err) { | ||
next(err); | ||
} | ||
}); | ||
}; | ||
|
||
bundles.forEach(function(bundle){ | ||
var bundlePath = bundle.bundlePath = | ||
bundlesDir + "" + bundleFilename(bundle); | ||
function concat(data) { | ||
var bundles = data.bundles; | ||
var configuration = data.configuration; | ||
var bundlesPath = configuration.bundlesPath; | ||
|
||
// If the bundle is explicity marked as clean, just resolve. | ||
if(bundle.isDirty === false) { | ||
return; | ||
} | ||
var bundlesDir = _.endsWith(bundlesPath, "/") ? | ||
bundlesPath : bundlesPath + "/"; | ||
|
||
// Adjusts URLs | ||
normalizeSource(bundle, bundlePath); | ||
bundles.forEach(function(bundle){ | ||
var bundlePath = bundle.bundlePath = | ||
bundlesDir + "" + bundleFilename(bundle); | ||
|
||
// Combines the source | ||
concatSource(bundle); | ||
}); | ||
// If the bundle is explicity marked as clean, just resolve. | ||
if(bundle.isDirty === false) { | ||
return; | ||
} | ||
|
||
next(null, data); | ||
// Adjusts URLs | ||
normalizeSource(bundle, bundlePath); | ||
|
||
// Combines the source | ||
concatSource(bundle); | ||
}); | ||
}; | ||
|
||
return data; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.