-
Notifications
You must be signed in to change notification settings - Fork 4
/
Gruntfile.js
81 lines (81 loc) · 1.77 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
module.exports = function (grunt) {
grunt.initConfig({
watch: {
mustache_html: {
files: ['pages/**/*.{json,mustache}'],
tasks: ['mustache_html']
},
sass: {
files: ['scss/style.scss'],
tasks: ['sass']
},
autoprefixer: {
files: ['tmp/style.css'],
tasks: ['autoprefixer']
},
babel: {
files: ['src/main.js'],
tasks: ['babel']
}
},
mustache_html: {
development: {
options: {
src: 'pages',
dist: '.',
type: 'mustache' // mustache Or hbs
},
globals: {
}
}
},
babel: {
options: {
sourceMap: true,
presets: ['es2015', 'stage-0']
},
dist: {
files: {
'dist/main.js': 'src/main.js'
}
}
},
sass: {
dist: {
options: {
style: "compressed"
},
files: {
'tmp/style.css': 'scss/style.scss'
}
}
},
autoprefixer: {
dist:{
files:{
'css/style.css':'tmp/style.css'
}
}
},
'http-server': {
'dev': {
root: '.',
port: 8000,
host: "0.0.0.0",
showDir: true,
autoIndex: true,
ext: "html",
runInBackground: true
}
}
});
//grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-babel');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-http-server');
grunt.loadNpmTasks('grunt-mustache-html');
grunt.registerTask('default', ['http-server', 'watch']);
grunt.registerTask('build', ['mustache_html', 'babel', 'sass', 'autoprefixer']);
};