You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2015/10/27 22:37:13 UTC
[47/47] allura git commit: [#7919] dedicated broccoli build for
navbar.js
[#7919] dedicated broccoli build for navbar.js
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/d21d71d1
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/d21d71d1
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/d21d71d1
Branch: refs/heads/db/7919
Commit: d21d71d1c1b95af7b4537acb6e615a82e515850e
Parents: 6075d97
Author: Dave Brondsema <da...@brondsema.net>
Authored: Mon Oct 26 17:28:55 2015 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Tue Oct 27 17:36:01 2015 -0400
----------------------------------------------------------------------
Brocfile.js | 32 +++++++++++++++++++++++++++-----
package.json | 1 +
2 files changed, 28 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/d21d71d1/Brocfile.js
----------------------------------------------------------------------
diff --git a/Brocfile.js b/Brocfile.js
index 71a8f90..78731fc 100644
--- a/Brocfile.js
+++ b/Brocfile.js
@@ -20,9 +20,11 @@ var babelTranspiler = require("broccoli-babel-transpiler");
var sourceMapConcat = require('broccoli-sourcemap-concat');
var funnel = require('broccoli-funnel');
var uglifyJavaScript = require('broccoli-uglify-js');
+var mergeTrees = require('broccoli-merge-trees');
+/* main output tree */
var tree = funnel('Allura/allura/public/nf/js', {
- include: ['*.es6.js'],
+ include: ['*.es6.js'],
});
tree = babelTranspiler(tree, {
browserPolyfill: true,
@@ -30,11 +32,31 @@ tree = babelTranspiler(tree, {
sourceMaps: 'inline', // external doesn't work, have to use extract below
comments: false,
});
+
+/* exactly what's needed for the navbar, so separate apps may use it too */
+var navbar_deps = funnel('Allura/allura/public/nf/js', {
+ include: ['underscore-min.js',
+ 'react-with-addons.js',
+ 'react-drag.js',
+ 'react-reorderable.js',
+ ],
+});
+navbar = mergeTrees([navbar_deps, tree]);
+navbar = sourceMapConcat(navbar, {
+ // headerFiles & footerFiles used to specify some that must come before or after others
+ headerFiles: ['react-with-addons.js'],
+ inputFiles: ['*.js'],
+ footerFiles: ['add-new-tool.es6.js','navbar.es6.js',],
+ outputFile: '/navbar.js',
+});
+
tree = sourceMapConcat(tree, {
- inputFiles: ['**/*'],
- outputFile: '/transpiled.js'
+ inputFiles: ['**/*'],
+ outputFile: '/transpiled.js'
});
+var output = mergeTrees([tree, navbar]);
+
if (process.env.BROCCOLI_ENV === 'production') {
/* can't use this for dev mode, since it drops the sourcemap comment even if we set output: {comments: true}
https://github.com/mishoo/UglifyJS2/issues/653
@@ -42,10 +64,10 @@ if (process.env.BROCCOLI_ENV === 'production') {
https://github.com/mishoo/UglifyJS2/issues/780
https://github.com/mishoo/UglifyJS2/issues/520
*/
- tree = uglifyJavaScript(tree, {
+ output = uglifyJavaScript(output, {
mangle: false,
compress: false
});
}
-module.exports = tree;
+module.exports = output;
http://git-wip-us.apache.org/repos/asf/allura/blob/d21d71d1/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index f850f00..47d384e 100644
--- a/package.json
+++ b/package.json
@@ -18,6 +18,7 @@
"broccoli": "^0.16.8",
"broccoli-babel-transpiler": "^5.4.5",
"broccoli-funnel": "^0.2.8",
+ "broccoli-merge-trees": "^0.2.3",
"broccoli-sourcemap-concat": "^2.0.1",
"broccoli-uglify-js": "^0.1.3"
}