Using Gulp in Cordova

Source: Internet
Author: User



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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.