Skip to content

Commit fcc4e4f

Browse files
committed
[Bundler] Support multiple asset roots, for consistency with the packager
1 parent 34546e3 commit fcc4e4f

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

local-cli/bundle.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ function getBundle(flags) {
1717
}
1818

1919
var assetRoots = [path.resolve(__dirname, '../../..')];
20-
if (flags.assetRoot) {
21-
assetRoots.push(path.resolve(flags.assetRoot));
20+
if (flags.assetRoots) {
21+
assetRoots = assetRoots.concat(flags.assetRoots.split(",").map(function(root) {
22+
return path.resolve(root);
23+
});
2224
}
2325

2426

@@ -58,7 +60,7 @@ function showHelp() {
5860
' --dev\t\tsets DEV flag to true',
5961
' --minify\tminify js bundle',
6062
' --root\t\tadd another root(s) to be used in bundling in this project',
61-
' --assetRoot\t\tspecify the root directory of app assets',
63+
' --assetRoots\t\tspecify the root directories of app assets',
6264
' --out\t\tspecify the output file',
6365
].join('\n'));
6466
process.exit(1);
@@ -71,7 +73,7 @@ module.exports = {
7173
dev: args.indexOf('--dev') !== -1,
7274
minify: args.indexOf('--minify') !== -1,
7375
root: args.indexOf('--root') !== -1 ? args[args.indexOf('--root') + 1] : false,
74-
assetRoot: args.indexOf('--assetRoot') !== -1 ? args[args.indexOf('--assetRoot') + 1] : false,
76+
assetRoots: args.indexOf('--assetRoots') !== -1 ? args[args.indexOf('--assetRoots') + 1] : false,
7577
out: args.indexOf('--out') !== -1 ? args[args.indexOf('--out') + 1] : false,
7678
}
7779

0 commit comments

Comments
 (0)