Git Product home page Git Product logo

express_gulp's Introduction

原来用的React+Webpack时,体验到那种同步压缩修改的快感。这次使用Express时,也想达到那种效果,一番折腾后,于是有了下图,项目地址:https://github.com/ycjcl868/Express_Gulp

目的

我使用Express+Ejs+Less开发,想开发时对所有资源进行压缩同步到浏览器端,Google搜索一遍,都不是太符合我的项目要求。于是看着Gulp文档结合npmjs.com终于折腾完毕。

Quickstart

安装

clone项目

$ git clone https://github.com/ycjcl868/Express_Gulp.git

切换目录,安装依赖

$ cd Express_Gulp && npm install

使用

开发模式,具备热更新,边修改浏览器边刷新,dev 端口 7000,配置项端口为 3001

$ npm run dev

构建项目,将文件压缩、打包、编译,输出 dist 目录

$ npm run build

生产模式,不具备热更新,运行在 3000 端口

$ npm run start

配置

下面说下我的配置方法:

我的目录结构:

├── app.js   # Express Server
├── bin
│   └── www  # 启动Server
├── dist     # 编译压缩目录(部署目录)
│   ├── css
│   ├── img
│   ├── js
│   ├── views
│   └── lib  # 第三方库目录(bower安装)
├── .bowerrc # bower前端安装库
├── gulpfile.js  # Gulp配置文件
├── package.json
├── public       # 开发目录 
│   ├── img
│   ├── js
│   └── less     
├── routes
│   ├── index.js
│   └── users.js
└── views      # html
    ├── error.ejs
    └── index.ejs

express_gulp's People

Contributors

ycjcl868 avatar

Watchers

 avatar  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.