Skip to content
Minko Gechev edited this page Sep 12, 2016 · 1 revision
  1. Define a destination directory e.g. in /tools/config/seed.config.ts
WAR_DEST = `${this.DIST_DIR}/`;
  1. Create a task in /tasks/project/build.war.ts:
import * as gulp from 'gulp';

var war = require('gulp-war');
var zip = require('gulp-zip');

import {
    APP_DEST, WAR_DEST
} from '../../config';

export = () => {

    return gulp.src(APP_DEST + '/**')
        .pipe(war({
            welcome: 'index.html',
            displayName: 'THE NAME OF MY APPLICATION',
        }))
        .pipe(zip('theNameOfMyApplication.war'))
        .pipe(gulp.dest(WAR_DEST));
};
  1. Add in gulpfile.ts your new task 'build.war' e.g. in 'build.prod' before done

Source.