Skip to content

Instantly share code, notes, and snippets.

@nickcherry
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickcherry/723fcdc3ba6e52f4b87b to your computer and use it in GitHub Desktop.
Save nickcherry/723fcdc3ba6e52f4b87b to your computer and use it in GitHub Desktop.
digital-platform-uglification
/********************************************************************/
/* Imports */
/********************************************************************/
var Gulp = require('gulp');
var Concat = require('gulp-concat');
var Uglify = require('gulp-uglify');
/********************************************************************/
/* Paths */
/********************************************************************/
var paths = {};
paths.src = {
dir: 'modules/mobile/j2ee/jcp.war'
};
paths.build = {
dir: 'modules/mobile/j2ee/jcp.war/build'
};
paths.scripts = {
destFile: 'application.min.js'
, destDir: paths.build.dir + '/js'
, src: [ paths.src.dir + '/**/*.js' ]
};
/********************************************************************/
/* Gulp Tasks */
/********************************************************************/
Gulp.task('scripts', function() {
return Gulp.src(paths.scripts.src)
.pipe(Concat(paths.scripts.destFile))
.pipe(Uglify({ mangle: false }))
.pipe(Gulp.dest(paths.scripts.destDir));
});
Gulp.task('default', ['scripts']);
{
"name": "digital-platform",
"version": "0.0.0",
"devDependencies": {
"gulp": "^3.8.8",
"gulp-concat": "^2.4.1",
"gulp-uglify": "^1.0.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment