gulp tutorial

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

When using Gulp-compass, the specified relative_assets is invalid

Conclusion:When using Gulp-compass, you need to specify relative:false , absolute positioning (such as the Http_images_path parameter) to be valid, code:function () { gulp.src (' sass/{,*/}*.scss ') . Pipe (Compass ({ './config.rb ', ' ... /css.release/touch ', ' sass ', relative:false }). Pipe (Reload ({ true})); });Story foreground:Previously used in the project is Grunt

Gulp Multi-image Auto-synthesis Sprite chart

Believe that the front-end students have done such a thing, in order to optimize the picture, reduce the request will be taken to cut the image of the icon, through PS (or other tools) to merge the pictures into a picture, and then through the CSS positioning of the style to write out to reference the HTML inside. For some projects with more pictures, this process may take us a day to achieve this. Today I bring you a tool to shorten this step to a few seconds to complete, what is the tool so am

Front End Industrial Tools Gulp first Experience

1. Global Installation Gulp:NPM Install--global Gulp2. Under the project directory, use the following command to create a basic Package.json fileNPM Init3. Installing GulpNPM Install--save-dev Gulp4. Install the required plugins such as:NPM Install gulp-contrib-uglify--save-dev5. Create a file named Gulpfile.js under the project root directory:var gulp = require (' Gulp

Write Gulp in ES6 grammar and manner

Installing dependent modulesNPM i-g gulpnpm I gulp Babel Babel-core babel-preset-es2015--save-devWhen you create a file. BABELRC (FileName): (File contents){ "presets": ["es2015"]}Gulpfile.babel.js (filename): (File contents)Import gulp from ' Gulp '; Gulp.task (' default ', cb = { console.log (' Hello World ')});In this way, the

For gulp, just compress the CSS inside the page and generate it in this folder. Min's File

Gulpfile.js file: var gulp = require (' Gulp '),Htmlmin = require (' gulp-htmlmin ');Gulp.task (' Default ', function () {Put your default task code here.Const OPTIONS = {Removecomments:true,//Clear HTML commentCollapsewhitespace:true,//Compressed HTMLCollapsebooleanattributes:true,//omitting the value of the Boolean property Removeemptyattributes:true,//Remove a

Gulp API Introduction

I. Introduction of GULP APIGulp itself can do very few things, mainly through the plug-in to provide a variety of functions, gulp itself only provides 4 very simple API, master these 4 APIs you basically mastered the gulp of all.1, GULP.SRC (globs[, Options])2, Gulp.dest (path[, Options])3, Gulp.task (name[, Deps], FN)4, Gulp.watch (Glob [, opts], tasks) or Gulp.

Gulp some important points in the process of automatically adding version numbers

1. Opennode_modules\gulp-rev\index.jsLine 144th Manifest[originalfile] == Originalfile + '? v= ' + File.revhash;2. Open Node_modules\gulp-rev\nodemodules\rev-path\index.jsreturn filename + '-' + hash +return filename + ext;3. Opennode_modules\gulp-rev-collector\index.jsif (Path.basename (Json[key]). Replace (new RegExp (opts.revsuffix), ')!==if (Path.basename ( J

Use of the Gulp plugin less

1. Create: Gulpfile.jsvar gulp = require (' Gulp '), = require (' gulp-less '); Gulp.task (function ( { gulp.src (' less/index.less '). Pipe (less ()) . Pipe (Gulp.dest (' dist ');});2. Create Package.jsonNPM Init3. Install Gulp to ProjectNPM Install--save-dev Gulp4. Install the plugin to the proje

Gulp Getting Started

1. IntroductionGulp.js is an automated build tool that developers can use to automate common tasks in project development. Gulp.js is built on node. JS and leverages the power of the node. JS stream to quickly build projects and reduce frequent IO operations.Gulp.js source files and the Gulp files you use to define tasks are implemented through JavaScript (or coffeescript) source code.2. Preparation of knowledge(1). command-Line OperationsOpen command

Gulp some tips

Gulp as an alternative to Grunt's task runner, the stream operation model based on Nodejs greatly reduces the operation of the disk, thus greatly improving performance.Gulp Error Handlingvar gulp = require ('Gulp'); var coffee= Require ('Gulp-coffee'); var concat= Require ('Gulp

Gulp using an external configuration file

This is good because it makes the task very clean and Config.json can be reused by other task runtimes (such as grunt).Config.json{" desktop": {" src": [ "Dev/desktop/js/**/*.js", "!dev/desktop/js/vendor/**" ], "dest": "Build/desktop/js" }, "mobile": { "src": [ "Dev/mobile/js/**/*.js", "!dev/mobile/js/vendor /** " ], " dest ":" Build/mobile/js " }}  Gulpfile.jsNPM Install--save-dev Gulp

The difference between Webpack and gulp

Gulp should compare with grunt, their difference I will not say, say the use of it. Gulp/grunt is a tool that optimizes the front end workflow. For example, automatically refresh the page, combo, compression css, JS, compile less and so on. Simply put, you can use Gulp/grunt and then configure the plugin you need to do what you need to do manually before.When it

The Postcss of Gulp development tools

Reference article: http://www.cnblogs.com/givebest/p/4771154.htmlPackage.json1 {2"Name": "Postcss",3"Version": "1.0.0",4"description": "",5"Main": "Gulpfile.js",6"Scripts": {7"Test": "Echo \" Error:no test specified\ " exit 1"8 },9"Author": "",Ten"License": "ISC", One"Devdependencies": { A"Autoprefixer": "^6.3.6", -"Autoprefixer-core": "^6.0.1", -"Cssgrace": "^3.0.0", the"Cssnext": "^1.8.4", -"Gulp": "^3.9.1", -"

Gulp-css-spriter Sprite Chart synthesis

First, the configurationAfter migrating from grunt to gulp, it was found that many features were not grunt so cool, but similar features supported, such as Sprite, slightly weaker, but also very goodNPM Address: Https://www.npmjs.com/package/gulp-css-spriter/https://www.npmjs.com/package/grunt-css-spriteVargulp=require (' Gulp '), minifycss=require ('

"simple comprehension" The difference between Gulp and Webpack

The basic differences between gulp and Webpack:Gulp can be js,html,css,img compressed packaging, is an automated build tool, you can compress multiple JS files or CSS into a file, and can be compressed into a single line, so as to reduce the file volume, speed up requests and reduce the number of requests And Gulp has a task definition to process transactions, thus building the overall process, which is a f

Can javascript-gulp have a plugin that outputs the TPL of the Smarty template to HTML?

Can gulp have a plugin that outputs the TPL of the Smarty template to HTML? Development environment:An old project now to develop a new module, the previous development process is the front end to write the backend to .html .tpl use the Smarty template engine to synchronize rendering.Problems encountered:There are a lot of repetitive content that can be traversed with a for loop in a static page, so I want to write it directly at the front end with t

Gulp introducing Header/footer to the page

Preface: In writing static page, the common head and the bottom or the sidebar, each write a page, should copy and paste, whenever modified, but also to the original header, footer modification, this and its trouble; not updated, some effects can not see the effect of the overall effect.Solution: With gulp plug-ins can be header, footer, sidebar static page into each required page, only need to write a note, compile, will be in the note header, footer

How do Gulp and webpack work together?

How do Gulp and webpack work together? Webpack used for modular packaging, I use the laravel, but the feeling is not used webpack. There are a bunch of JS files, CSS files, image files,Placed in the JS, CSS, image folder under Public/assets/, respectively,The feeling is just packed into a file with gulp, this is not webpack what matter?When will it be webpack? Reply content: How do

Gulp and Webpack-stream Integrated configuration

Webpack is very powerful, but there are deficiencies, batch processing is still gulp better. Can we combine the advantages of both? This article explains how to integrate gulp and Webpack1. Installing Webpack-streamVery important plug-ins, of course, can also directly use the official Webpack, integrated way can see Webpack official website. But Webpack-stream is more consistent with Gulp's streaming syntax

gulp-content-includer--merging HTML files introduced by modules

InstallationNPM Install Gulp-content-includerUsevar gulp = require (' Gulp '); var contentincluder = require (' Gulp-content-includer '); var rename = require (' Gulp-rename '); Gulp.task (' concat ', function() { gulp.src ("./content.html") . PIPE ( Contentincluder ({

Total Pages: 15 1 .... 11 12 13 14 15 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.