-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
111 lines (109 loc) · 4.33 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
"bower-install-simple": {
options: {
production: true,
}
},
requirejs: {
compile: {
options: {
mainConfigFile: "app/webroot/js/common.js",
appDir: "app/webroot/dist-prep/",
baseUrl: "js/",
dir: "app/webroot/dist/",
skipDirOptimize: true,
// optimize: "none",
modules: [{
name: "common",
include: ['jquery', 'bootstrap', 'backbone', 'underscore', 'marionette', 'marionette.mustache', 'mustache', 'backbone.wreqr', 'backbone.babysitter', 'text']
}, {
// module names are relative to baseUrl/paths config
name: 'app/app.collectible.detail',
exclude: ['common', 'rickshaw']
}, {
name: 'app/app.home',
exclude: ['common', 'rickshaw']
}, {
name: 'app/app.user.profile',
exclude: ['common', 'rickshaw']
}, {
name: 'app/app.user.settings',
exclude: ['common', 'rickshaw']
}, {
name: 'app/app.collectible.edit',
exclude: ['common', 'rickshaw']
}, {
name: 'controllers/app.home.controller',
exclude: ['common', 'rickshaw']
}, {
name: 'controllers/app.user.profile.controller',
exclude: ['common', 'rickshaw']
}, {
name: 'controllers/app.user.settings.controller',
exclude: ['common', 'rickshaw']
}]
}
}
},
copy: {
prep: {
files: [
// includes files within path and its sub-directories
{
expand: true,
cwd: 'app/webroot/templates/',
src: ['**'],
dest: 'app/webroot/dist-prep/templates/'
}, {
expand: true,
cwd: 'app/webroot/js/',
src: ['**'],
dest: 'app/webroot/dist-prep/js/'
}, {
expand: true,
cwd: 'app/webroot/bower_components/',
src: ['**'],
dest: 'app/webroot/dist-prep/bower_components/'
}
]
},
clean: {
files: [
// includes files within path and its sub-directories
{
expand: true,
cwd: 'app/webroot/dist/js/',
src: ['**'],
dest: 'app/webroot/js/'
}, {
expand: true,
cwd: 'app/webroot/dist/templates/',
src: ['**'],
dest: 'app/webroot/templates/'
}, {
expand: true,
cwd: 'app/webroot/dist/bower_components/',
src: ['**'],
dest: 'app/webroot/bower_components/'
}
]
}
},
clean: {
finish: {
src: ["app/webroot/dist-prep", "app/webroot/dist"]
}
}
});
grunt.loadNpmTasks("grunt-bower-install-simple");
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
// Default task(s).
grunt.registerTask('default', ['bower-install-simple']);
grunt.registerTask('install', ['bower-install-simple', 'requirejs']);
grunt.registerTask('install:production', ['bower-install-simple', 'copy:prep', 'requirejs', 'copy:clean', 'clean:finish']);
};