Java Reference
In-Depth Information
If you want to pass the project to another developer, just ensure that the
package.json file is included. The developer could then install all project de-
pendencies using:
$ npm install
The main JavaScript files that are written in development should be moved into a new
folder named src. The Gulp task will take the JavaScript file in this folder and pipe them
through the stripdebug and uglify plugins before saving the output in the js folder.
We now need to create the Gulp file that will run the task. Create a file called gulpfile.js
that contains the following lines of code and save it in the same directory as index.htm:
gulp = require('gulp'),
stripdebug = require('gulp-strip-debug'),
uglify = require('gulp-uglify');
source = 'src/*',
dest = 'js/';
// strip debugging and minify JS
gulp.task('js', function() {
return gulp.src(source)
// default task
gulp.task('default', ['js'], function() {
// watch for javascript changes, ['js']);
Search WWH ::

Custom Search