-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
59 lines (57 loc) · 1.8 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
/*
* bleepout-client gruntfile 12/14/14 [email protected]
*
* uglifies and concatenates all required css/js files, and then writes them inline in the index.html file.
*
* run "npm install" to install all dependencies; if you have not used Grunt before, you'll need to install it:
*
* > "npm install -g grunt-cli"
*
* run "grunt build" to produce production-ready optimized index.html file => dist/
* run "grunt minfiles" to process all files without inlining to index.html => .tmp/
*
*/
module.exports = function (grunt) {
grunt.initConfig({
clean: {
pre: ['dist/'],
post: ['.tmp/']
},
copy: {
main: {
expand: true,
cwd: 'src',
src: 'index.html',
dest: '.tmp/',
filter: 'isFile'
}
},
useminPrepare: {
html: 'src/index.html',
options: {
dest: '.tmp/'
}
},
usemin: {
html: ['.tmp/index.html']
},
inline: {
dist: {
options: {
tag: 'min_'
},
src: ['.tmp/index.html'],
dest: ['dist/']
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-inline');
grunt.loadNpmTasks('grunt-usemin');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('minfiles', ['useminPrepare', 'copy', 'concat:generated', 'cssmin:generated', 'uglify:generated', 'usemin']);
grunt.registerTask('build', ['clean:pre', 'minfiles', 'usemin', 'inline', 'clean:post']);
};