/
gruntfile.js
78 lines (67 loc) · 2.22 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
module.exports = function(grunt) {
// Project configuration.
var runPath = 'C:/Program Files (x86)/Brackets/Brackets.exe';
var buildPath = 'C:/Users/FreaK/AppData/Roaming/Brackets/extensions/user/brackets.swatcher';
var packPath = 'build/';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
main: {
files: ['styles/src/**/*.less', 'src/**/*.js'],
tasks: ['less:main', 'cssmin:main', 'copy']
}
},
less: {
main: {
files: {
'styles/swatcher.css': 'styles/src/swatcher.less'
}
}
},
cssmin: {
main: {
files: [{
expand: true,
cwd: 'styles',
src: ['*.css', '!*.min.css'],
dest: 'styles',
ext: '.min.css'
}]
}
},
run: {
brackets: {
cmd: runPath
}
},
copy: {
main: {
src: ['src/**', 'styles/*.min.css', 'tpl/**', 'main.js', 'package.json', 'modes.js','styles/images/**'],
dest: buildPath,
expand: true
},
},
compress: {
main: {
options: {
archive: packPath+'<%= pkg.name %>-<%= pkg.version %>.zip'
},
files: [{
src: ['src/**', 'styles/*.min.css', 'tpl/**', 'main.js', 'package.json', 'modes.js','styles/images/**'],
dest: '/'
}
]
}
}
});
// Plugins
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-run');
grunt.registerTask('pack', ['less', 'cssmin', 'compress']);
grunt.registerTask('build', ['less', 'cssmin', 'copy']);
grunt.registerTask('build-start', ['less', 'cssmin', 'copy', 'run']);
};