Skip to content
This repository was archived by the owner on Apr 26, 2022. It is now read-only.

Commit

Permalink
required changes to gulp to get ng2 rc1 build up and running
Browse files Browse the repository at this point in the history
  • Loading branch information
ThorstenHans committed Jun 6, 2016
1 parent bc539c4 commit 79e6268
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
32 changes: 17 additions & 15 deletions gulp.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ module.exports = {
folder: './src/BoardZ/',
files: {
injectables: [
'./dist/www/scripts/es6-shim.min.js',
'./dist/www/scripts/shims_for_IE.js',
'./dist/www/scripts/vendor.min.js',
'./dist/www/scripts/angular2.min.js',
'./dist/www/scripts/system.min.js',
'./dist/www/scripts/system.setup.js',
'./dist/www/css/vendor.min.css',
'./dist/www/css/app.css'
'./dist/www/css/app.css',
'./dist/www/scripts/shim.min.js',
'./dist/www/scripts/zone.js',
'./dist/www/scripts/reflect.js'
],
electronFiles: './electron/**/*.*',
cordovaFiles: './cordova/',
Expand Down Expand Up @@ -67,23 +68,24 @@ module.exports = {
'./src/BoardZ/vendor/bootstrap/js/bootstrap.js',
'./src/BoardZ/vendor/fastclick/fastclick.js',
'./src/BoardZ/vendor/admin-lte/js/app.js',
'./src/BoardZ/vendor/leaflet-js/leaflet-src.js'],
angular2: [
'./node_modules/systemjs/dist/system-polyfills.js',
'./node_modules/angular2/bundles/angular2-polyfills.js',
'./node_modules/systemjs/dist/system.src.js',
'./node_modules/rxjs/bundles/Rx.js',
'./node_modules/angular2/bundles/angular2.dev.js',
'./node_modules/angular2/bundles/http.dev.js',
'./node_modules/angular2/bundles/router.dev.js'
]
'./src/BoardZ/vendor/leaflet-js/leaflet-src.js'

],
angular2rc1deps: [
'./node_modules/core-js/client/shim.min.js',
'./node_modules/zone.js/dist/zone.js',
'./node_modules/reflect-metadata/reflect.js'
],
angular2: './node_modules/@angular/**/*',
rxjs: './node_modules/rxjs/**/*',
systemJs: './node_modules/systemjs/dist/system.src.js'
}
},
ts: {
config: './tsconfig.json'
},
targets: {
angular2MinJs: 'angular2.min.js',
systemMinJs: 'system.min.js',
vendorMinJs: 'vendor.min.js',
vendorMinCss: 'vendor.min.css',
buildFolder: './dist/www',
Expand Down
21 changes: 14 additions & 7 deletions gulpTasks/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
ts = require('gulp-typescript'),
tsConfig = ts.createProject(config.ts.config),
sourcemaps = require('gulp-sourcemaps'),
rename = require('gulp-rename'),
inject = require('gulp-inject'),
uglify = require('gulp-uglify'),
watch = require('gulp-watch'),
Expand All @@ -32,6 +33,8 @@

gulp.task('[private-web]:bundle-vendor-scripts', function () {
var builder = new Builder();
gulp.src(config.source.files.angular2rc1deps)
.pipe(gulp.dest(path.join(config.targets.buildFolder, 'scripts')));

return builder.loadConfig(config.systemJsConfig)
.then(function () {
Expand All @@ -48,9 +51,12 @@

gulp.task('[private-web]:copy-angular2-scripts', function () {
return gulp.src(config.source.files.angular2)
.pipe(concat(config.targets.angular2MinJs))
//.pipe(uglify())
.pipe(gulp.dest(path.join(config.targets.buildFolder, 'scripts/')));
.pipe(gulp.dest(path.join(config.targets.buildFolder, '@angular')));
});

gulp.task('[private-web]:copy-rxjs-scripts', function () {
return gulp.src(config.source.files.rxjs)
.pipe(gulp.dest(path.join(config.targets.buildFolder, 'rxjs')));
});

gulp.task('[private-web]:copy-system-setup-script', function () {
Expand All @@ -65,10 +71,10 @@
});


gulp.task('[private-web]:copy-shim', function () {
// es6shim cant be bundled with angular-polyfills see https://github.com/angular/angular/issues/6706
return gulp.src(config.source.files.shim)
gulp.task('[private-web]:copy-system', function () {
return gulp.src(config.source.files.systemJs)
.pipe(uglify())
.pipe(rename(config.targets.systemMinJs))
.pipe(gulp.dest(path.join(config.targets.buildFolder, 'scripts/')))
});

Expand Down Expand Up @@ -124,9 +130,10 @@
[
'[private-web]:bundle-vendor-scripts',
'[private-web]:copy-angular2-scripts',
'[private-web]:copy-rxjs-scripts',
'[private-web]:copy-system-setup-script',
'[private-web]:copy-cordova-script',
'[private-web]:copy-shim',
'[private-web]:copy-system',
'[private-web]:build-app-scripts',
'[private-web]:vendor-css',
'[private-web]:copy-fonts',
Expand Down

0 comments on commit 79e6268

Please sign in to comment.