Open Package.json, add main:gulpfile.js
Add gulp,vs 20,150 Intelligence to dependencies tointelligently get dependencies from npm such as:
be aware of the output during the add process , such as
If you are prompted to update the node JS or NPM version too low, if the update is too low to adjust the vs2015 settings as follows, cancel the use of the sandbox version.
the added dependencies are displayed as follows :
Open gulpfile.js write the following code , intended to rename and compress js.
var gulp = require ("Gulp");
var rename = require ("Gulp-rename");
var uglify = require ("gulp-uglify");
Gulp.task ("Minjs", function () {
GULP.SRC (["Www/scripts/*.js", "!www/scripts/*.min.js"])
. Pipe (rename ({suffix: '. Min '}))
. Pipe (Uglify ())
. Pipe (Gulp.dest ("www/scripts"));
When you are finished writing, run the task as shown in:
If you right-click No task to run Program Explorer , you need to get from the View menu , such as :
Task Runner Program resource manager as shown , right-click to run .
the generated JS looks like this:
Using Gulp in Cordova