-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
87 lines (83 loc) · 2.48 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
"use strict";
module.exports = (grunt) => {
require('load-grunt-tasks')(grunt);
//require('load-grunt-config')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
js: ['./public/js/**/*.js', '!./public/js/**/*.min.js'],
jsmin: ['./public/js/**/*.min.js'],
css: ['./public/css/**/*.css', '!./public/css/**/*.min.css'],
cssmin: ['./public/css/**/*.min.css']
},
compass: {
dist: {
options: {
sassDir: './resources/sass',
cssDir: './public/css',
environment: 'development',
outputStyle: 'nested',
},
tasks: ['cssmin'],
},
},
cssmin: {
dist: {
files: {
'public/css/<%= pkg.name %>.min.css': ['public/css/**/*.css']
}
}
},
concat: {
dist: {
files: {
'public/js/<%= pkg.name %>.js': ['./resources/js/**/*.js',]
}
}
},
uglify: {
dist: {
files: {
'public/js/<%= pkg.name %>.min.js': ['public/js/**/*.js']
}
}
},
injector: {
options: {
template: './public/index.html',
addRootSlash: false,
ignorePath: 'public/'
},
local_dependencies: {
files: {
'./public/index.html': ['public/js/**/*.js', 'public/css/**/*.css'
,'public/js/**/*.min.js', 'public/css/**/*.min.css'],
}
}
},
watch: {
css: {
files: ['./resources/sass/**/*.scss'],
tasks: ['compass', 'clean:cssmin', 'cssmin', 'clean:css'],
},
js: {
files: ['./resources/js/**/*.js'],
tasks: ['concat', 'clean:jsmin', 'uglify', 'clean:js'],
}
}
});
grunt.registerTask('serve:dev', ['compass', 'concat', 'injector']);
grunt.registerTask('serve', [
'compass',
'clean:cssmin',
'cssmin',
'clean:css',
'concat',
'clean:jsmin',
'uglify',
'clean:js',
'injector',
'watch'
]);
grunt.registerTask('default', ['serve']);
}