Use of ejs plug-in for Gulp frontend Automation

Source: Internet
Author: User

Use of ejs plug-in for Gulp frontend Automation

 

 

Gulpfile. js Configuration

 

Gulp. task ('ejs', function () {gulp. src ([./app/**/*. html ,! App/html/common /**/*. html]). pipe (plugins. ejs ({}, {ext: '.html '})). pipe (gulp. dest (. /dist /)). pipe (plugins. notify ({message: ejs task complete }))});

 

Src Source Path

The src method can be a string such as./app/**/*. html"

 

It can also be an array. The first element matches all html files in the app, the second element does not match all the files suffixed with html under app/html/common /.
 
Pipe refers to the pipeline. Put ejs into the pipeline. If ext: html is not specified here, the generated file is not suffixed with html.
 
Dest is the destination path where the generated file is stored.
 
 
 
 
 
 
 
 

 

 

 

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.