/
Gruntfile.js
54 lines (45 loc) · 1.45 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
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
build: {
src: 'js/app.js', // input
dest: 'js/build/app.min.js' // output
}
},
sass: {
dist: { // Target
files: [{
expand: true,
cwd: 'css',
src: ['*.scss'],
dest: 'css/build',
ext: '.css'
}]
}
},
// watch for sccs files and compile to css
watch: {
sass: {
files: ['css/*.scss'],
tasks: ['sass']
}
}
// // reload page after the scss file had been compiled
// livereload: {
// // Here we watch the files the sass task will compile to
// // These files are sent to the live reload server after sass compiles to them
// options: { livereload: true },
// files: ['css/build/*', 'js/build/*']
// }
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
// load sass
grunt.loadNpmTasks('grunt-contrib-sass');
// watch
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task(s).
grunt.registerTask('default', ['uglify', 'sass']);
};