forked from asimov-deploy/asimov-deploy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
117 lines (100 loc) · 2.64 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: ["dist/"],
less: {
bootstrap: {
options: { paths: ["public/css/bootstrap/"] },
files: { 'dist/debug/bootstrap.css' : 'public/css/bootstrap/bootstrap.less' }
},
asimov: {
options: { paths: ["public/css/", "public/css/bootstrap/"] },
files: { 'dist/debug/asimov.css' : 'public/css/asimov.less' }
}
},
handlebars: {
compile: {
options: { namespace: "JST" },
files: {
"dist/debug/templates.js": "public/templates/**/*.handlebars"
}
}
},
requirejs: {
compile: {
options: {
mainConfigFile: "public/app/config.js",
out: "dist/debug/require.js",
name: "config",
optimize: 'none'
}
}
},
concat: {
dist: {
src: ['public/libs/almond.js', 'dist/debug/require.js', 'public/libs/handlebars.runtime.js', 'dist/debug/templates.js'],
dest: 'dist/debug/require.js'
}
},
uglify: {
dist: {
files: {
'dist/release/require.js': ['dist/debug/require.js']
}
}
},
cssmin: {
dist: {
files: {
'dist/release/asimov.css': ['dist/debug/asimov.css'],
'dist/release/bootstrap.css': ['dist/debug/bootstrap.css']
}
}
},
watch: {
node_src: {
files: ["*.js", "app/**/*.js", "test/backend/*.js"],
tasks: ["jshint", "mochaTest"]
},
ui_src: {
files: ["public/**/*.js", "public/templates/**/*" ],
tasks: ["default"]
},
less: {
files: ["**/*.less" ],
tasks: ["less"]
}
},
jshint: {
nodecode: {
src: ['app/**/*.js', 'server.js', 'test/backend/*.js'],
options: { jshintrc: 'jshint-rules-nodejs.jshintrc' }
},
frontend: {
src: ['public/app/**/*.js'],
options: { jshintrc: 'jshint-rules-frontend.jshintrc' }
}
},
mochaTest: {
test: {
options: { reporter: 'spec' },
src: ['test/backend/**/*.js']
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-handlebars');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-notify');
// Default task(s).
grunt.registerTask('default', ['clean', 'jshint', 'requirejs', 'less', 'handlebars', 'concat', 'mochaTest']);
grunt.registerTask("release", ['default', 'cssmin', 'uglify', 'mochaTest']);
};