This repository has been archived by the owner on Oct 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
/
build.config.js
187 lines (174 loc) · 6.6 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
/* jslint camelcase: false */
/**
* This file/module contains all configuration for the build process.
*/
module.exports = {
/**
* The `build_dir` folder is where our projects are compiled during
* development and the `compile_dir` folder is where our app resides once it's
* completely built.
*/
build_dir: 'build',
compile_dir: 'dist',
test_dir: 'test',
sass_dir: 'assets/scss',
app_base: 'src/app',
/**
* Port on which the app is running
*/
app_port: 9000,
/**
* Server port on which the app local server is running
*/
server_port: 9001,
/**
* Server host on which the app local server is running
*/
server_host: 'localhost',
/**
* This specifies the folder in `data/` for the specific shop you want to
* build the app.
*/
shop_data_dir: 'local',
/*
* This is a collection of file patterns that refer to our app code (the
* stuff in `modules/`). These file paths are used in the configuration of
* build tasks. `js` is all project javascript, `app_tpl` contains template
* files for our app's code. `html` is just our main HTML file, `scss` is
* our main stylesheet, and `unit` and `e2e` contains our app's unit and
* e2e ests.
*/
app_files: {
js: [
'<%= app_base %>/**/*.js',
'!<%= app_files.jsunit %>',
'!<%= app_files.jse2e %>',
'!<%= app_files.jse2epage %>'
],
jsunit: ['<%= app_base %>/**/*.unit.spec.js'],
jse2e: ['<%= app_base %>/**/*.e2e.spec.js'],
jse2epage: ['<%= app_base %>/**/*.e2e.page.js'],
jse2esuites: [
{
name: 'app',
src: ['<%= app_base %>/*.e2e.*.js'],
},
{
name: 'search',
src: ['<%= app_base %>/search/*.e2e.*.js'],
},
{
name: 'cart',
src: ['<%= app_base %>/cart/*.e2e.*.js'],
},
{
name: 'categories',
src: ['<%= app_base %>/categories/*.e2e.*.js'],
},
{
name: 'products',
src: ['<%= app_base %>/products/*.e2e.*.js'],
},
{
name: 'product',
src: ['<%= app_base %>/product/*.e2e.*.js']
}
],
app_tpl: ['<%= app_base %>/**/*.tpl.html'],
html: ['index.html'],
scss: ['<%= app_base %>/**/*.scss']
},
tpl: {
/**
* This option defines the destination where for the html2js task.
* In other words, this is the file that gets generated, containing
* all module definitions for templates.
*/
js_file: '<%= build_dir %>/templates/templates.js',
/**
* Defines the name of the angular module that gets generated by
* html2js.
*/
module_name: 'templates'
},
/**
* `test_files` are included in the testing process. We need `angular-mocks`
* to run our test so we define it here.
*/
test_files: {
js: [
'bower_components/angular-mocks/angular-mocks.js'
]
},
/**
* We separate these data files from `vendor_files` because we have to embed
* them as additional files. They are only used for development purposes,
* because the backend generates these files on the file and embed them
* inline.
*/
data_files: {
config: [
'<%= build_dir %>/data/<%= shop_data_dir %>/cc.config.js',
],
lang: [
'<%= build_dir %>/data/<%= shop_data_dir %>/cc.lang.js'
],
inject: [
'<%= build_dir %>/data/<%= shop_data_dir %>/cc.inject.js',
],
},
/**
* This is the same as `app_files`, except it contains patterns that
* reference vendor code (`vendor/`) that we need to place into the build
* process somewhere. While the `app_files` property ensures all
* standardized files are collected for compilation, it is the user's job
* to ensure non-standardized (i.e. vendor-related) files are handled
* appropriately in `vendor_files.js`.
*
* The `vendor_files.js` property holds files to be automatically
* concatenated and minified with our project source files.
*
* The `vendor_files.css` property holds any CSS files to be automatically
* included in our app.
*/
vendor_files: {
js: [
'vendor/angular-unstable/angular.js',
'vendor/angular-unstable/angular-animate.js',
'vendor/angular-unstable/angular-sanitize.js',
'node_modules/angular-bindonce/bindonce.js',
'node_modules/hammerjs/hammer.js',
'vendor/ui-router/angular-ui-router.js',
'vendor/ui-modal/*.js',
'vendor/snap/snap.js',
'vendor/snap/angular-snap.js',
'node_modules/sofa-core/dist/sofa.core.js',
'node_modules/sofa-storages/dist/sofa.storages.js',
'node_modules/sofa-logging-service/dist/sofa.loggingService.js',
'node_modules/sofa-device-service/dist/sofa.deviceService.js',
'node_modules/sofa-url-parser-service/dist/sofa.urlParserService.js',
'node_modules/sofa-url-construction-service/dist/sofa.urlConstructionService.js',
'node_modules/sofa-search-service/dist/sofa.searchService.js',
'node_modules/sofa-tracking/dist/sofa.tracking.js',
'node_modules/sofa-user-service/dist/sofa.userService.js',
'node_modules/sofa-basket-service/dist/sofa.basketService.js',
'node_modules/sofa-wishlist-service/dist/sofa.wishlistService.js',
'node_modules/sofa-image-resizer-service/dist/sofa.imageResizerService.js',
'node_modules/sofa-pages-service/dist/sofa.pagesService.js',
'node_modules/sofa-checkout-service/dist/sofa.checkoutService.js',
'node_modules/sofa-couch-service/dist/sofa.couchService.js',
'node_modules/sofa-coupon-service/dist/sofa.couponService.js',
'node_modules/sofa-state-resolver-service/dist/sofa.stateResolverService.js',
'node_modules/sofa-base/src/core/*.js',
'node_modules/sofa-base/src/**/*.js',
'!node_modules/sofa-base/src/directives/ccElasticViews/**/*.js',
'node_modules/sofa-base/dist/cc.angular.templates.js'
],
css: [],
scss: [
'node_modules/sofa-base/**/*.scss',
'vendor/snap/angular-snap.scss',
'vendor/ui-modal/bootstrap-dialog.scss'
]
}
};