gulp js tutorial

Want to know gulp js tutorial? we have a huge selection of gulp js tutorial information on alibabacloud.com

Gulp Tutorial Compression Merge Css,js

(' Gulp '), minifycss = require (' Gulp-minify-css '), concat = require (' Gulp-concat '), Uglify = require (' gulp-uglify '), rename = require (' Gulp-rename '), gutil = require (' Gulp-util ');2. Add an execution

Gulp Tutorial Gulp Chinese API

return the current task of the event stream, see the following example);JavaScript 1234567891011 Gulp. Task(' testless ', function () { return Gulp. SRC([' less/style.less ']) . Pipe(less()) . Pipe(gulp. Dest('./css ')); }); gulp. Task ( ' minicss ' , Span class= "Cr

Front-end build tool Gulp Getting Started tutorial

devDependencies value to indicate that the project needs to rely on gulp.DependenciesYou can indicate to other participants in the project that the node module in the development environment and production environment is lazy and want to know more about it to see the Package.json documentation.Fifth step: Create a new Gulpfile file and run the GulpAfter installing gulp we need to tell it what to do for us, first of all we need to figure out what task

Gulp Getting Started Tutorial

complete ' })); the }); + //Images AGulp.task (' images ',function() { the returnGULP.SRC (' images/* ') +. Pipe (Cache (Imagemin ({optimizationlevel:3, progressive:true, Interlaced:true }))) -. Pipe (Gulp.dest (' images ')) $. Pipe (Notify ({message: ' Images task complete ' })); $ }); - //Default Task -Gulp.task (' Default ',function() { theGulp.start (' Styles ', ' scripts ', ' images ')); - });Wuyi //Watch theGulp.task (' Watch ',function() { - //Watch. scss files WuGulp.watch (' styles

Gulp-uglify "JS Compression"----Gulp Series (four)

This section implements JS compression, before the implementation of compression, the first configuration JS task, set the source directory and output directory.On the basis of the series (c) code, expand it.1. Locate Gulp->config.js and configure the source directory (SRC->IMG) and output directory (BUILD->IMG) for JS:New JS

Gulp Configuration Version Number tutorial Gulp-rev-append

12345678910111213 ! DOCTYPE HTML> html> head> link rel="stylesheet" href="Css/[email protected] @hash"> /head> body> div>Hello, world ! /div> img src="Img/test.jpg?r[email protected] @hash" alt="" c24>/> /body> /HTML> 4, Configuration Gulpfile.js4.1. Basic use (Add a version number to the page reference URL to clear the page cache)JavaScript 12345678 var

Gulp Tutorial: What Gulp can do, the front-end assembly force why use it

our unit tests automatically before committing.Code AnalysisWe write JavaScript often have some potential bugs, such as forget to add a semicolon, a variable does not wait, use some JavaScript code analysis tool, can help us to check some common problems. HTML reference JavaScript or CSS files such as we need to use Bower to refer to the front-end JavaScript and CSS third-party libraries, if the version upgrade, add Remove and so on by hand to modify the HTML, first more time-consuming, the sec

Gulp Tutorial: What Gulp can do, the front-end assembly force why use it

tool to run our unit tests automatically before committing.Code AnalysisWe write JavaScript often have some potential bugs, such as forget to add a semicolon, a variable does not wait, use some JavaScript code analysis tool, can help us to check some common problems.HTML referencing JavaScript or CSS filesFor example, we need to use bower and the like to reference the front-end JavaScript and CSS third-party library, then if the version upgrade, add Remove and so on by hand to modify the HTML,

Gulp CSS, JS, img compression and CSS images BASE64__JS

after the prompt execution cnpm Gulp install--save-dev; 7.2. This example takes gulp-less as an example (compiling the less file), and the command prompt executes the cnpm install gulp-less--save-dev; 7.3, will be installed in the Node_modules gulp-less directory, the directory has a

Front-end build tool Gulp Getting Started tutorial

them to the dist/ directory.Default taskgulp.task(‘default‘, function(){ gulp.run(‘lint‘, ‘sass‘, ‘scripts‘); gulp.watch(‘./js/*.js‘, function(){ gulp.run(‘lint‘, ‘sass‘, ‘scripts‘); });});At this point, we create a default task that is based on other tasks. Use .run() methods to correlate and run the tasks defined above, use the .watch() method to listen for file changes in the specified directory, and

Front-end build tool Gulp Getting Started tutorial (share)

() { gulp.src ('./js/*.js ') . Pipe (concat (' all.js ')) . Pipe (Gulp.dest ('./ Dist '). Pipe ( rename (' All.min.js ')). Pipe ( uglify ()) . Pipe (Gulp.dest ('./dist ') ));});The scripts task merges js/ all the JS files in the directory and outputs them to the dist/ directory, a

Node.js-based JavaScript project building Tools Gulp Tutorial _javascript Tips

NPM Install Gulp--save-dev What is Gulp?Gulp is a new generation of front-end project building tools, you can use Gulp and its plug-ins to your project code (LESS,SASS) to compile, you can compress your JS and CSS code, or even compress your pictures,

Gulp Troubleshooting Publishing online file (CSS and JS) caching issues

Gulp Troubleshooting Publishing online file (CSS and JS) caching issuesthe reason of this article: the current often online after the release of the document to constantly refresh the page and a long time, the page CSS and JS file to take effect, especially for the current time to do the mall, built-in browser cache is very serious, We used to fix the post-online

Gulp Implement package Js/css/img/html file, and add version number to js/css/img file

Refer to the Packaging tutorial:Http://www.cnblogs.com/tugenhua0707/p/4069769.htmlHttp://www.cnblogs.com/tugenhua0707/p/4982646.htmlHttp://www.tuicool.com/articles/viequayKey points of implementation:1, how to Run Gulp task, join the new good one the following tasks:// Grammar Check function () { gulp.src (' js/**/*.js '). Pipe (Jshint ()) . Pipe

Gulp Getting Started Tutorial

() { gulp.src ('./scss/*.scss ') . Pipe (Sass ()) . Pipe (Gulp.dest ('./css ‘));});/ /merge, compress file Gulp.task (' Scripts ', function () { gulp.src ('./js/*.js ') . Pipe (concat (' all.js ')) . PIPE ( Gulp.dest ('./dist ')). Pipe (rename (' All.min.js ')). Pipe (Uglity ( )) . Pipe (Gulp.dest ('./dist '));}); /Default task Gulp.task (' Defa

node. JS-based automation Tool Gulp

node. JS-based automation Tool GulpWhat is Gulp?Gulp is a stream-based code-building tool in the front-end development process, and it is the building block of the automation project; she can not only optimize the site resources, but also in the development process a lot of repetitive tasks can be automated using the correct tools, she can not only very happy to

Yeoman+bower+gulp Web front-end Automation workflow (beginner tutorial)

');}); Gulp.task (' Lint:test ', () = {return Lint (' Test/spec/**/*.js ', {fix:true, env: {mocha:true}}) . Pipe (Gulp.dest (' test/spec/**/*.js ');}); /compile Htmlgulp.task (' html ', [' Styles ', ' Scripts '], () = {return gulp.src (' app/*.html ')//useref this plugin, which can detect references in HTML CSS and JS, you can perform the merging and compr

Front-end Automation Tool Gulp automatically add version number tutorial

Before, I introduced to learn to install and configure the front-end Automation Tool gulp, feel gulp indeed than grunt configuration is much simpler, so I decided to further study gulp, went to the Internet to check the data, found that gulp can also automatically add version number, This function is usually when I upd

Use gulp to compress html, js, css, and images of the project,

Use gulp to compress html, js, css, and images of the project,1, download and install node access http://nodejs.org, and then click the big greeninstallClick to directly run the program after the download is complete, and everything is ready. Npm will be installed along with the installation package. 2. Open the code line.Node-v // view the node version. if the version is displayed, the installation is succ

Use Gulp Automation to pack and merge front-end static resources (CSS, JS file compression, add version numbers)

The project update iterations that are being done are more frequent, the front-end code is often packaged for deployment, and manual integration of code files is cumbersome and time-consuming, so it is decided to use Gulp instead of manually doing this work.Front-end static resources in the release of the update will face the problem of client browser cache (refer to this article), to solve this problem can be used in two ways: The overriding method (

Total Pages: 14 1 2 3 4 5 .... 14 Go to: Go

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.