[Grunt] Concatenating Your Javascript with grunt-contrib-concat
JavaScript with your CONCAT grunt contrib
2023-09-14 09:00:55 时间
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
相关文章
- JavaScript学习总结(十七)——Javascript原型链的原理详解编程语言
- javascript获取曲线路径每个像素的坐标详解编程语言
- Oracle 中的 WITH 语句使用技巧(oracle with用法)
- Oracle中利用WITH子句的使用(oracle中的with)
- 从Oracle中挖掘洞见坚实的With表(oracle with表)
- javascript跟随鼠标的文字带滚动效果
- JavaScript验证浏览器是否支持javascript的方法小结
- .net动态显示当前时间(客户端javascript)
- JavaScript性能陷阱小结(附实例说明)
- 关于JavaScript的with语句的使用方法
- JavaScript大数据相加的问题
- JavaScript学习笔记(二)js对象
- jQuery对象和Javascript对象之间转换的实例代码
- 解析JavaScript中的标签语句