-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
54 lines (51 loc) · 1.41 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
module.exports = function(grunt) {
grunt.initConfig({
assembler: {
build: {
options: {
css: "build/css/style.css",
js: "build/js/script.js",
output: "build/html/index.html"
}
},
dev: {
options: {
css: "snippets/css/style.css",
js: "snippets/js/script.js",
output: "docs/debug.html"
}
}
},
cssmin: {
preBuild: {
files: {
'build/css/style.css': 'snippets/css/style.css'
}
}
},
htmlmin: {
postBuild: {
options: {
removeComments: true,
collapseWhitespace: true,
maxLineLength: 32000
},
src: 'build/html/index.html',
dest: 'docs/index.html'
}
},
uglify: {
preBuild: {
src: 'snippets/js/script.js',
dest: 'build/js/script.js'
}
}
});
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadTasks('tasks');
grunt.registerTask('dev', ['assembler:dev']);
grunt.registerTask('build', ['uglify:preBuild', 'cssmin:preBuild', 'assembler:build', 'htmlmin:postBuild']);
grunt.registerTask('default', ['dev', 'build']);
};