-
Notifications
You must be signed in to change notification settings - Fork 8
/
Gruntfile.js
67 lines (65 loc) · 1.8 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
module.exports = function(grunt){
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.initConfig({
sass: {
options: {
sourceMap: false
},
dist: {
files: {
'app/build/hive.css': 'app/assets/stylesheets/hive.scss',
'app/build/reset.css': 'app/assets/stylesheets/reset.scss'
}
}
},
browserify: {
ui: {
files: {
'app/build/application.js': ['app/assets/javascripts/main.js']
}
},
ai: {
files: {
'app/public/ai.js': ['app/assets/javascripts/workers/ai-worker.js']
}
}
},
concat: {
css: {
src: ['app/build/reset.css', 'node_modules/material-design-lite/material.css', 'app/build/hive.css'],
dest: 'app/public/application.css',
},
js: {
src: ['app/build/application.js', 'node_modules/material-design-lite/material.js'],
dest: 'app/public/application.js',
},
},
copy: {
main: {
files: [ {expand: true, src: ['app/assets/images/*'], dest: 'app/public/images', flatten: true, filter: 'isFile'} ]
}
},
clean: {
build: ['app/build'],
dist: ['app/public']
},
watch: {
css: {
files: ['app/assets/stylesheets/*.scss'],
tasks: ['sass', 'concat:css', 'clean:build'],
options: {
livereload: true,
}
},
js: {
files: ['lib/*.js', 'app/assets/javascripts/**/*.js'],
tasks: ['browserify', 'concat:js', 'clean:build']
}
}
});
grunt.registerTask('default', ['clean', 'sass', 'browserify', 'concat', 'copy', 'clean:build']);
}