-
Notifications
You must be signed in to change notification settings - Fork 10
/
Gruntfile.js
51 lines (50 loc) · 1.37 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
module.exports = function(grunt) {
grunt.initConfig({
requirejs:{
build: {
options:{
appDir:'src',
dir:'build',
baseUrl:'js',
paths: {
'jquery': 'lib/jquery/jquery-2.0.0.min',
'jquery.qrcode':'lib/jquery-qrcode/jquery.qrcode.min',
'underscore': 'lib/underscore/underscore-amd-min',
'underscore.string': 'lib/underscore/underscore.string.min',
'knockout':'lib/knockout/knockout-2.2.1',
'mousetrap':'lib/mousetrap/mousetrap.min',
'hammer':'lib/hammer/hammer.min',
'bootstrap-modal':'lib/bootstrap-modal/bootstrap-modal',
'bootstrap-modalmanager':'lib/bootstrap-modal/bootstrap-modalmanager',
'text': 'lib/require/text'
},
preserveLicenseComments: false,
name:'app'
}
}
},
replace:{
build:{
options:{
variables:{'timestamp': '<%= new Date().getTime() %>'}
},
files:[
{src:['build/index.html'],dest:'build/index.html'},
{src:['build/app.html'],dest:'build/app.html'}
]
}
},
clean:{
build:[
'build/build.txt','build/img/*.ai'
]
}
});
grunt.loadNpmTasks('grunt-requirejs');
grunt.registerTask('less','Optimize Less files',function(){
require('lessless').optimizeProject('build');
});
grunt.loadNpmTasks('grunt-replace');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask('build',['requirejs','less','replace','clean']);
}