-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
86 lines (83 loc) · 2.95 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'client/src/js/<%= pkg.name %>.js',
dest: 'client/build/js/<%= pkg.name %>.min.js'
}
},
sass: {
dist: {
options: {
style: 'expanded'
},
files: {
'client/build/css/main.css': 'client/src/css/main.scss'
}
}
},
copy: {
main: {
cwd: 'client/src/html/',
src: '**',
dest: 'client/build/',
filter: 'isFile',
expand: true
}
},
concat: {
jquery: {
files: {
'client/build/js/dep/jquery.js': ['bower_components/jquery/dist/jquery.js'],
'client/build/js/dep/backbone.js': ['bower_components/backbone/backbone.js'],
'client/build/js/dep/underscore.js': ['bower_components/underscore/underscore.js']
}
}
},
shell: {
'jsx-shared': {
command: "node ./node_modules/react-tools/bin/jsx shared/src/jsx shared/build/js"
},
'jsx-server': {
command: "node ./node_modules/react-tools/bin/jsx server/src/jsx server/build/js"
},
'jsx-client': {
command: "node ./node_modules/react-tools/bin/jsx client/src/jsx client/build/js/prebrowserify"
}
},
browserify: {
'./client/build/js/soccr.js': ['./client/build/js/prebrowserify/soccr.js']
},
clean: [
'./client/build',
'./shared/build',
'./server/build'
]
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
// Load Sass plugin.
grunt.loadNpmTasks('grunt-contrib-sass');
// Load copy plugin.
grunt.loadNpmTasks('grunt-contrib-copy');
// Load bower-install-simple
grunt.loadNpmTasks("grunt-bower-install-simple");
// Load concat
grunt.loadNpmTasks("grunt-contrib-concat");
// Load shell
grunt.loadNpmTasks("grunt-shell");
// Load browserify
grunt.loadNpmTasks('grunt-browserify');
// Load clean
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask('bower', ['bower-install-simple', 'concat']);
grunt.registerTask('jsx', ['shell:jsx-shared', 'shell:jsx-server', 'shell:jsx-client']);
// Default task(s).
grunt.registerTask('default', ['uglify', 'sass', 'copy', 'bower', 'jsx', 'browserify']);
};
/* vim: expandtab:tabstop=4:softtabstop=4:shiftwidth=4:set filetype=javascript: */