Skip to content

fix(vendor): fixed broccoli concat for vendor files #177

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 6, 2016
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion addon/ng2/blueprints/ng2/files/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var Angular2App = require('angular-cli/lib/broccoli/angular2-app');

module.exports = function(defaults) {
var app = new Angular2App(defaults, {
vendorFiles: []
vendorNpmFiles: []
});
return app.toTree();
}
30 changes: 8 additions & 22 deletions lib/broccoli/angular2-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var compileWithTypescript = require('./broccoli-typescript').default;
var fs = require('fs');
var Funnel = require('broccoli-funnel');
var mergeTrees = require('broccoli-merge-trees');
var Project = require('ember-cli/lib//models/project');
var Project = require('ember-cli/lib/models/project');

module.exports = Angular2App;

Expand All @@ -17,10 +17,10 @@ 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',
'es6-shim/es6-shim.js',
'angular2/bundles/angular2-polyfills.js',
'rxjs/bundles/Rx.js',
'angular2/bundles/angular2.dev.js',
'angular2/bundles/http.dev.js',
Expand Down Expand Up @@ -55,18 +55,12 @@ Angular2App.prototype.toTree = function() {
destDir: 'vendor'
});

var vendorNpmInputFiles = vendorNpmFiles.map(function(file) {
return '**/' + file.substr(file.lastIndexOf('/') + 1);
});

var vendorNpmJs = new Concat(vendorNpmTree, {
inputFiles: [ //TODO: figure out how to make it a glob that maintains the order of the files
'**/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'
],
inputFiles: vendorNpmInputFiles,
outputFile: '/thirdparty/vendor.js'
});

Expand All @@ -81,14 +75,6 @@ Angular2App.prototype.toTree = function() {
allowNone: true
});

// var appJs = new Concat(mergeTrees([tsTree, jsTree]), {
// inputFiles: [
// '*.js',
// '**/*.js'
// ],
// outputFile: '/app.js'
// });

return mergeTrees([
assetTree,
tsSrcTree,
Expand Down