-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntFile.js
76 lines (63 loc) · 2.1 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
var request = require('request');
module.exports = function(grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserSync: {
bsFiles: {
src: ['./resources/build/*.html', './resources/build/css/**/*.css', './resources/build/js/**/*.js']
},
options: {
watchTask: true,
server: {
baseDir: "./resources/build"
}
}
},
concat: {
js: {
src: ['resources/assets/js/plugins/*.js', 'resources/assets/js/main.js'],
dest: 'resources/build/js/scripts.js',
},
css: {
src: ['resources/assets/css/**/*.css'],
dest: 'resources/build/css/style.css',
}
},
uglify: {
js: {
src: ['resources/build/js/scripts.js'],
dest: 'resources/build/script.min.js',
}
},
sass: {
dist: {
options: {
style: 'compact' // Can be nested, compact, compressed, expanded.
},
files: [{
expand: true, // Recursive Output style.
cwd: "resources/assets/sass/", // The startup directory
src: ["**/*.scss"], // Source files
dest: "resources/build/css/", // Destination
ext: ".css" // File extension
}]
}
},
watch: {
js: {
files: ['resources/assets/js/**/*.js'],
tasks: ['concat', 'uglify']
},
sass: {
files: 'resources/assets/sass/**/*.{scss,sass}',
tasks: ['sass']
},
}
});
//grunt.registerTask('watch', ['concat', 'uglify', 'watch']);
grunt.registerTask('default', ['sass', 'browserSync', 'watch']);
}