-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathGruntfile.js
69 lines (67 loc) · 1.52 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
basic: {
src: [
'js/local_storage.js',
'js/tracking.js',
'js/resize.js',
'js/main_view.js',
'js/custom_view.js',
'js/options.js',
'js/layout.js',
'js/utility.js',
'js/display.js',
'js/main.js'
],
dest: 'public/<%= pkg.name %>.js'
},
extras: {
src: [
'js/background.js'
],
dest: 'public/<%= pkg.name %>_background.js'
}
},
jshint: {
beforeconcat: [
'js/local_storage.js',
'js/tracking.js',
'js/resize.js',
'js/main_view.js',
'js/custom_view.js',
'js/options.js',
'js/layout.js',
'js/utility.js',
'js/display.js',
'js/main.js',
'js/background.js'
],
afterconcat: [
'public/<%= pkg.name %>.js',
'public/<%= pkg.name %>_background.js'
]
},
uglify: {
my_target: {
files: {
'public/<%= pkg.name %>.min.js': ['public/<%= pkg.name %>.js'],
'public/<%= pkg.name %>_background.min.js': ['public/<%= pkg.name %>_background.js']
}
}
},
less: {
production: {
options: {
cleancss: true
},
files: {
"public/style.css": "css/index.less"
}
}
}
});
['grunt-contrib-concat', 'grunt-contrib-jshint', 'grunt-contrib-uglify', 'grunt-contrib-less'].forEach(grunt.loadNpmTasks);
grunt.registerTask('default', ['concat', 'jshint', 'uglify', 'less']);
};