Giter Site home page Giter Site logo

ray-grunt-template's Introduction

ray-grunt-template

一个基于 gruntjs 及其多个插件的Web前端开发项目初始化模板,切图好帮手。

使用步骤

  1. 安装 nodejsgruntjs 环境
  2. npm install -g grunt-init 安装 grunt-init
  3. 创建项目目录,mkdir yourproject
  4. git clone [email protected]:lpgray/ray-grunt-template.git
  5. 使用 ray-grunt-template,运行 grunt-init ~/ray-grunt-template
  6. 安装依赖,运行 npm install
  7. 运行 grunt dev enjoy it!

特性

CSS

  • 使用Less写样式,然后使用grunt-contrib-less来进行编译、合并
  • 使用grunt-contrib-cssmin来进行压缩(或者直接使用grunt-contrib-less来压缩)

JavaScript

  • 使用grunt-contrib-concat进行代码合并
  • 使用grunt-contrib-uglify进行代码压缩

HTML

使用 grunt-includes 来做动态引用公共模板,能像后端动态include一样来制作前端页面。

src/html文件夹中编辑html,最终的html是置于src

Build

  • 每次build代码都会生成全新的css与js文件,以构建时间做为文件名称的一部分
  • 使用process-html来替换引用部分

Develop

  • 采用更强大的 browser-sync 工具,来实现多屏同步开发,CSS自动注入无需刷新就可以看到浏览器效果,而且还能多屏幕同步操作,运行 grunt dev 使用此开发模式。

ray-grunt-template's People

Contributors

lpgray avatar

Watchers

 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.