Giter VIP home page Giter VIP logo

gulp_template's Introduction

全局安装gulp 用yarn global并不能使用gulp命令,使用npm add -g

  1. 安装gulp-pug 处理pug
  2. 安装gulp-less 处理less
  3. 安装browser-sync实现修改刷新
  4. 安装gulp-clean 每次构建之前清除
说明

使用pug和less开发页面,可使用pug组件,运行gulp生成dist文件

  • 项目文件写在src中
  • components: pug组件
  • libs: js
  • pages: pug页面
  • style:css
  • 页面配置写在config.js中
{
   page: 'index', // 页面名称, 必填
   css: ['header', 'index'], // 页面中需要合并的css,选填
   js: ['news'] // 页面中需要合并的js,选填
}

page格式说明

doctype html
html(lang="en")
  head
    meta(charset="UTF-8")
    title Document
    <!-- 合并的css,已页面名命名 -->
    link(type="text/css" rel="stylesheet" href="./css/index.css")
    <!-- 单独引进的css -->
    link(type="text/css" rel="stylesheet" href="./css/swiper.css")
    script(src="./js/rem.js")
  body
    include ../components/fiuger.pug
    include ../components/news.pug
    <!-- 单独引进的js -->
    script(src="./js/swiper.js")
    <!-- 合并的js,以页面名命名 -->
    script(src="./js/index.js")



gulp_template's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.