Skip to content

fix(vendors): reorder vendor libraries to work properly with routes #171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 3, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions lib/broccoli/angular2-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ function Angular2App(defaults, options) {
Angular2App.prototype.toTree = function() {
var sourceTree = 'src';
var vendorNpmFiles = [
'es6-shim/es6-shim.js',
'systemjs/dist/system-polyfills.js',
'angular2/bundles/angular2-polyfills.js',
'systemjs/dist/system.src.js',
'rxjs/bundles/Rx.js',
'angular2/bundles/angular2.dev.js',
'angular2/bundles/http.dev.js',
'angular2/bundles/router.dev.js',
'angular2/bundles/upgrade.dev.js',
'es6-shim/es6-shim.js',
'rxjs/bundles/Rx.js',
'systemjs/dist/system.src.js',
'systemjs/dist/system-polyfills.js'
'angular2/bundles/upgrade.dev.js'
];

if (this.options.vendorNpmFiles) {
vendorNpmFiles = vendorNpmFiles.concat(this.options.vendorNpmFiles);
}
Expand All @@ -49,23 +49,23 @@ Angular2App.prototype.toTree = function() {
exclude: ['**/*.ts', '**/*.js', 'src/tsconfig.json'],
allowEmpty: true
});

var vendorNpmTree = new Funnel('node_modules', {
files: vendorNpmFiles,
include: vendorNpmFiles,
destDir: 'vendor'
});

var vendorNpmJs = new Concat(vendorNpmTree, {
inputFiles: [ //TODO: figure out how to make it a glob that maintains the order of the files
'**/angular2-polyfills.js',
'**/system.src.js',
'**/system-polyfills.js',
'**/system.src.js',
'**/es6-shim.js',
'**/angular2-polyfills.js',
'**/Rx.js',
'**/angular2.dev.js',
'**/http.dev.js',
'**/router.dev.js',
'**/upgrade.dev.js',
'**/Rx.js'
'**/upgrade.dev.js'
],
outputFile: '/thirdparty/vendor.js'
});
Expand All @@ -90,11 +90,11 @@ Angular2App.prototype.toTree = function() {
// });

return mergeTrees([
assetTree,
tsSrcTree,
tsTree,
jsTree,
this.index(),
assetTree,
tsSrcTree,
tsTree,
jsTree,
this.index(),
vendorNpmJs,
thirdPartyJs
], { overwrite: true });
Expand Down