forked from ecupaio/coil-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgruntfile.js
More file actions
98 lines (96 loc) · 2.21 KB
/
gruntfile.js
File metadata and controls
98 lines (96 loc) · 2.21 KB
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
89
90
91
92
93
94
95
96
97
98
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
imagemin: {
target: {
files: [{
expand: true,
cwd: 'img/',
src: ['**/*.{png,jpg,gif,jpeg,svg}'],
dest: 'img/'
}]
}
},
watch: {
imagemin: {
files: 'img/*.{png,jpg,gif,jpeg,svg}',
tasks: ['newer:imagemin:target']
},
terser: {
files: ['js/*.js',"js/min/!*.min.js"],
tasks: ['newer:terser:target']
},
css: {
files: ['scss/*.scss'],
tasks: ['sass', 'postcss']
}
},
terser: {
options: {
compress: true,
mangle: false
},
target: {
files: [{
expand: true,
cwd: "js/",
src: ["*.js", "!*.min.js"],
dest: "js/min/",
ext: ".min.js"
}]
}
},
sass: {
options: {
compress: false
},
scss: {
files: [{
expand: true,
cwd: 'scss/',
src: ['*.scss','!_*.scss'],
dest: 'css/',
ext: '.min.css'
}]
}
},
postcss: {
options: {
processors: [
require('autoprefixer')({overrideBrowserslist: ['last 2 versions']}),
require('csswring')()
]
},
mincss: {
files: [{
expand: true,
cwd: 'css/',
src: ['*.min.css'],
dest: 'css/'
}]
}
},
shell: {
jekyllServe: {
command: 'bundle exec jekyll serve --livereload '
}
},
concurrent: {
target: ['shell:jekyllServe','watch'],
options: {
logConcurrentOutput: true
}
}
});
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-postcss');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-newer');
grunt.loadNpmTasks('grunt-terser');
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('default', ['terser','sass', 'postcss','concurrent:target']);
};