-
Notifications
You must be signed in to change notification settings - Fork 39
/
Gruntfile.js
59 lines (56 loc) · 1.61 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
* grunt 打包文件
*/
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
requirejs: {
compile: {
options: {
name: "main",
optimize: "uglify",
mainConfigFile: "./js/main.js",
out: "./js/all.js"
}
}
},
uglify: [{
src: 'js/lib/modernizr/modernizr-2.6.2.js',
dest: 'js/lib/modernizr/modernizr-2.6.2.min.js'
}],
// css 合并
css_import: [{
src: ['css/app.css'],
dest: 'css/app.min.css'
}],
// css压缩
cssmin: [{
src: 'css/app.min.css',
dest: 'css/app.min.css'
}],
// erro check
jshint: {
all: [
'js/controller/*.js',
'js/model/*.js',
'js/view/*.js',
'js/app-router.js',
'js/app.js',
'js/main.js',
'js/router.js',
'js/transitions.js',
'js/utils.js'
],
options: {
browser: true, // browser environment
devel: true
}
}
});
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-css-import');
grunt.loadNpmTasks('grunt-css');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.registerTask('default', ['css_import', 'cssmin', 'uglify', 'requirejs','jshint']);
}