-
Notifications
You must be signed in to change notification settings - Fork 7
/
Gruntfile.js
88 lines (86 loc) · 2.94 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
module.exports = function (grunt) {
require('jit-grunt')(grunt);
grunt.initConfig({
less: {
development: {
options: {
compress: true,
yuicompress: true,
optimization: 2
},
files: {
'dist/faketerminal.css': 'src/less/faketerminal.less' // destination file and source file
}
}
},
uglify: {
compressed: {
files: {
'dist/faketerminal.min.js': [
'src/js/core/namespace.js',
'src/js/core/defaults.js',
'src/js/core/main.js',
'src/js/core/output.js',
'src/js/core/input.js',
'src/js/core/filesystem.js',
'src/js/core/history.js',
'src/js/core/command.js',
'src/js/commands/*.js',
'src/js/core/jquery.js'
]
},
options: {
sourceMap: true,
sourceMapName: 'dist/faketerminal.min.js.map'
}
},
uncompressed: {
files: {
'dist/faketerminal.js': [
'src/js/core/namespace.js',
'src/js/core/defaults.js',
'src/js/core/main.js',
'src/js/core/output.js',
'src/js/core/input.js',
'src/js/core/filesystem.js',
'src/js/core/history.js',
'src/js/core/command.js',
'src/js/commands/*.js',
'src/js/core/jquery.js'
]
},
options: {
mangle: false,
compress: false,
beautify: true,
preserveComments: true,
sourceMap: true,
sourceMapName: 'dist/faketerminal.js.map'
}
}
},
watch: {
less: {
files: ['src/less/**/*.less'],
tasks: ['less'],
options: {
nospawn: true
}
},
uglify: {
files: [
'src/js/**/*.js'
],
tasks: [
'uglify:compressed',
'uglify:uncompressed'
],
options: {
nospawn: true
}
}
}
});
grunt.registerTask('build', ['less', 'uglify:compressed', 'uglify:uncompressed']);
grunt.registerTask('default', ['build', 'watch']);
};