forked from explodybits/bs-loophole
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
82 lines (82 loc) · 2.53 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
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
scripts: {
files: ['src/*.js'],
tasks: ['uglify', 'copy', 'clean'],
options: {
spawn: false
}
},
css: {
files: ['src/*.less', 'demo/assets/less/*.less']
,tasks: ['less', 'cssmin']
},
remove: {
files: ['demo/assets/css/screen.css'],
tasks: ['copy', 'clean']
}
},
uglify: {
js: {
src: ['src/bs-loophole.js'],
dest: 'dist/bs-loophole.min.js'
},
build: {
files: {
'demo/assets/js/bs-loophole.min.js': 'src/bs-loophole.js'
}
}
},
less: {
development: {
options: {
paths: ['src/'],
yuicompress: false
},
files: {
'dist/screen.css': 'src/screen.less',
'demo/assets/css/screen.css': 'demo/assets/less/screen.less'
}
}
},
cssmin: {
options: {
shorthandCompacting: false,
roundingPrecision: -1
},
target: {
files: {
'dist/screen.min.css': ['dist/screen.css'],
'demo/assets/css/screen.min.css': ['demo/assets/css/screen.css']
}
}
},
copy:{
build:{
cwd: 'src',
src: ['**', '!**/*.min', '!**/*.less'],
dest: 'dist',
expand: true
}
},
clean:{
build: {
src: ['dist/screen.min.css']
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask('default', ['watch']);
grunt.registerTask(
'build',
'Compiles all the assets and copies the files to the build directory.',
['uglify', 'less', 'cssmin', 'copy', 'clean']
);
};