[Grunt] Concatenating Your Javascript with grunt-contrib-concat
Combine serval javascript files together.
For angular project, make sure you add angular.min.js first, then app.js (which contains main module) second, after those, you can add other javascript files.
/**
* Created by Answer1215 on 11/16/2014.
*/
module.exports = function(grunt) {
grunt.initConfig({
stylus:{
compile:{
options: {
compress: false
},
files: {
"app/css/app.css": "styl/app.styl"
}
}
},
watch:{
stylus:{
files: ['styl/**/*.styl'],
tasks: ['stylus:compile']
},
css:{
options: {livereload: true},
files: ['app/css/**.css']
},
html:{
options: {livereload: true},
files: ['**.html']
},
script: {
options: {livereload: true},
files: ['app/js/**.js']
}
},
concat:{
options: {
separator: ';'
},
js:{
src: ['bower_components/angular/angular.min.js', 'app/js/app.js', 'app/js/**.js'],
dest: "build/app.js"
}
}
}); grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-stylus');
grunt.loadNpmTasks('grunt-contrib-concat');
}
Run:
grunt concat
Read More:
https://github.com/gruntjs/grunt-contrib-concat
https://egghead.io/lessons/grunt-concatenating-your-javascript
[Grunt] Concatenating Your Javascript with grunt-contrib-concat的更多相关文章
- Grunt 之 使用 JavaScript 语法检查工具 jshint
前端开发环境准备好了,我们准备开始进行开发. 前端开发的主力语言是 JavaScript,这是一种脚本语言,没有编译器,也就没有了编译器带给我们的语法检查,怎样保证代码的质量呢?jshint 是一个强 ...
- 基于Grunt构建一个JavaScript库
现在公认的JavaScript典型项目需要运行单元测试,合并压缩.有些还会使用代码生成器,代码样式检查或其他构建工具. Grunt.js是一个开源工具,可以帮助你完成上面的所有步骤.它非常容易扩展,并 ...
- grunt入门讲解1:grunt的基本概念和使用
Grunt和 Grunt 插件是通过 npm 安装并管理的,npm是 Node.js 的包管理器. Grunt 0.4.x 必须配合Node.js >= 0.8.0版本使用.老版本的 Node. ...
- 【grunt第三弹】grunt在前端实际项目中的应用
前言 [grunt第二弹]30分钟学会使用grunt打包前端代码(02) [grunt第一弹]30分钟学会使用grunt打包前端代码 经过前两次的学习,我们了解了grunt打包的一些基础知识,对于压缩 ...
- grunt入门讲解6:grunt使用步骤和总结
Grunt是啥? 很火的前端自动化小工具,基于任务的命令行构建工具. Grunt能帮我们干啥? 假设有这样一个场景: 编码完成后,你需要做以下工作 HTML去掉注析.换行符 - HtmlMin CSS ...
- [Grunt] Development Automation Tasks with Grunt
With Grunt you can automate core tasks for your AngularJS project. In this lesson we will take a loo ...
- javascript中数组的concat()方法 - 数组连接
<html> <head> <title>数组的concat()方法</title> <script> /* 数组的concat()方法: ...
- JavaScript的push(),pop(),concat()方法
push 方法 将新元素添加到一个数组中,并返回数组的新长度值. arrayObj.push([item1 [item2 [. . . [itemN ]]]]) 参数 arrayObj 必选项.一个 ...
- javascript中slice() splice() concat()操作数组的方法
这三个操作数组,哪个返回一个新数组呢.上代码 splice()方法,用于插入,删除和替换. var arr=[1,2,3,4,5]; var arr1=arr.splice(1,3); console ...
随机推荐
- zimg 启动命令
cd zimgcd bin ./zimg conf/zimg.lua
- java 读入文件 BufferedReader
package com.mkyong; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOExcep ...
- 【BZOJ 3566】 3566: [SHOI2014]概率充电器 (概率树形DP)
3566: [SHOI2014]概率充电器 Description 著名的电子产品品牌 SHOI 刚刚发布了引领世界潮流的下一代电子产品——概率充电器:“采用全新纳米级加工技术,实现元件与导线能否通电 ...
- kotlin 类 接口 抽象类 子类类型有限的class 。sealed class
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha 用 private 封装,可以防止别人修改. 就好像 内有高压,危险,不让碰.
- Linux 自动化部署
1.pexpect Pexpect 是 Don Libes 的 Expect 语言的一个 Python 实现,是一个用来启动子程序,并使用正则表达式对程序输出做出特定响应,以此实现与其自动交互的 Py ...
- [转]关于Java对中文排序的问题
1 2 3 4 5 6 Comparator chinese_cmp = Collator.getInstance(Locale.CHINA); String[] strs = new ...
- web前端笔记整理,从入门到上天,周周更新
由于大前端知识点太多,所以一一做了分类整理,详情可见本人博客 http://www.cnblogs.com/luxiaoyao/ 一.HTML 1.注释 格式:<!-- 注释内容 --> ...
- ALAssetsLibrary使用
在iOS中,我们调用摄像头和选择相册中的资源,我们可以使用:UIImagePickerController类来完成. 当然,我们也可以不使用UI的形式来访问iOS设备的相册资源. 那就是使用:AL ...
- Virtual Treeview - Paint cycles and stages
The most complex process in Virtual Treeview is without doubts its painting. Read here what stages V ...
- CC1101是一种低成本真正单片的UHF收发器
CC1101是一种低成本真正单片的UHF收发器,为低功耗无线应用而设计.电路主要设定为在315.433.868和915MHz的ISM(工业,科学和医学)和SRD(短距离设备)频率波段,也可以容易地设置 ...