-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.config.js
110 lines (89 loc) · 3.15 KB
/
build.config.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
/**
* This file/module contains all configuration for the build process.
*/
module.exports = {
// required for source maps to work
server: 'http://localhost:3000',
// this dir contains compiled assets for both dev and prod mode
compile_dir: 'assets',
src_dir: 'frontend',
views_dir: 'app/views',
templates_file: '<%= compile_dir %>/templates.js',
less_compiled: '<%= compile_dir %>/less.css',
less_compiled_na: '<%= compile_dir %>/less_na.css',
css_dir: '<%= compile_dir %>/styles',
lib_dir: '<%= compile_dir %>/vendor',
test_files: {
js: [
'<%= lib_dir %>/angular-mocks/angular-mocks.js',
]
},
// all paths should point to compile dir
// We can control CSS inclusion order / exclude some files:
// First included files in 'css_first' (in order defined)
// Next included files from 'css' (in alphabetical order)
// All files listed in 'css_exclude' are not included
// 'css_non_angular' are files which are the only css included for non-angular pages
app_files: {
tests: '<%= compile_dir %>/app/**/*.spec.js',
js: [
'<%= compile_dir %>/app/**/*.js',
'!<%= app_files.tests %>'
],
less_angular: [
'<%= css_dir %>/shared/**/*.less',
'<%= compile_dir %>/app/**/*.less'
],
less_non_angular: [
'<%= css_dir %>/**/*.less'
],
tpl: ['<%= compile_dir %>/app/**/*.tpl.html']
},
app_template: 'app/views/includes/scripts.tpl.html',
vendor_files: {
// these should be with prefix to preserve order
js_vendor_all: [
'<%= lib_dir %>/jquery/jquery.js',
'<%= lib_dir %>/lodash/dist/lodash.js'
],
js_vendor_angular: [
'<%= lib_dir %>/angular/angular.js',
'<%= lib_dir %>/angular-ui-router/release/angular-ui-router.js',
'<%= lib_dir %>/angular-ui-utils/ui-utils.js',
'<%= lib_dir %>/restangular/dist/restangular.js'
],
js_vendor_non_angular: [
'<%= lib_dir %>/bootstrap/dist/bootstrap.js'
],
css_vendor_all: [
'<%= lib_dir %>/bootstrap/dist/css/bootstrap.css'
],
css_vendor_angular: [
],
css_vendor_non_angular: [
],
// note that there should be at least 2 elements in array to expansion work
js_exclude: [
'<%= lib_dir %>/angular-mocks/angular-mocks.js',
''
],
js: [
'<%= vendor_files.js_vendor_all %>',
'<%= vendor_files.js_vendor_angular %>',
'!{<%= vendor_files.js_exclude %>}'
],
js_non_angular: [
'<%= vendor_files.js_vendor_all %>',
'<%= vendor_files.js_vendor_non_angular %>',
'!{<%= vendor_files.js_exclude %>}'
],
css: [
'<%= vendor_files.css_vendor_all %>',
'<%= vendor_files.css_vendor_angular %>'
],
css_non_angular: [
'<%= vendor_files.css_vendor_all %>',
'<%= vendor_files.css_vendor_non_angular %>'
]
}
};