This repository has been archived by the owner on Oct 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathuniversal-redux.config.js
239 lines (211 loc) · 5.96 KB
/
universal-redux.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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
const projectRoot = process.cwd();
const sourceRoot = `${projectRoot}/src`;
const isProduction = process.env.NODE_ENV === 'production';
module.exports = {
/*
// Express configuration
*/
server: {
/*
// The host to run the Express universal renderer. See src/server.js.
//
// Expects: String
*/
host: process.env.HOST || 'localhost',
/*
// The port to run Express universal renderer will run on. See src/server.js.
//
// Expects: Number
*/
port: process.env.PORT || 3000,
/*
// The path at which static assets are served from. If omitted, Express will
// serve any static assets from your project root 'static' directory.
// Optional.
//
// Expects: String
*/
staticPath: projectRoot + '/static',
/*
// The path at which a favicon image will be served from using the `serve-favicon`
// library. If omitted, Express will not serve a favicon. Optional.
//
// Expects: String
*/
// favicon: projectRoot + '/static/favicon.ico',
/*
// The maximum age, in milliseconds, for which a static asset will be
// considered fresh, per the Cache-Control max-age property. If
// ommitted, defaults to 0. Optional.
//
// Expects: Number
*/
// maxAge: 0
/*
// The renderer returns middleware for universal rendering. This config option sets the framework to
// which this middleware should be compatible.
// Expects: String
// options: 'express' || 'koa'
*/
webFramework: 'express'
},
/*
// Globals available to both serverside and clientside rendering.
// You may also add your own here.
*/
globals: {
/*
// Whether or not to run redux-logger
//
// Expects: Boolean
*/
__LOGGER__: !isProduction,
/*
// Whether or not to run redux-devtools
//
// Expects: Boolean
*/
__DEVTOOLS__: !isProduction,
/*
// Whether or not to show redux-devtools when page loads.
//
// Expects: Boolean
*/
__DEVTOOLS_IS_VISIBLE__: true
},
/*
// Enable eslint checks per Webpack build. Will not be run
// on production.
//
// Expects: Boolean
*/
lint: {
enabled: false
// config: projectRoot + '/.eslintrc'
},
/*
// Providers for the root component to assemble. Built in options
// include 'react-router', 'react-router-redux', 'redux-async-connect',
// 'async-props'. Custom root components may accept additional options.
// Optional. If unspecified will use react-router, react-router-redux,
// and redux-async-connect. Experimental.
//
// Expects: Array
*/
providers: [
'react-router',
'react-router-redux',
'redux-async-connect'
],
/*
// The root component factory file. Optional. Will be added to Webpack aliases.
*/
// rootClientComponent: sourceRoot + '/rootClientComponent.js',
/*
// The root component factory file. Optional.
*/
// rootServerComponent: sourceRoot + '/rootServerComponent.js',
/*
// The root component factory file. Optional. Will be added to Webpack aliases.
// Is overridden by either rootClientComponent or rootServerComponent.
*/
// rootComponent: sourceRoot + '/rootComponent.js',
/*
// Project level babelConfig to be merged with defaults. Optional.
//
// Expects: String
*/
// babelConfig: projectRoot + '/.babelrc',
/*
// Enable native desktop notifications for Webpack build events.
// Will not be run on production.
//
// Expects: Boolean
*/
notifications: false,
/*
// Path to a file with customizations for the default
// webpack-isomorphic-tools configuration. Optional.
//
// Expects: String
*/
toolsConfigPath: __dirname + '/webpack-isomorphic-tools.config.js',
/*
// When eneabled, will output Webpack and Webpack Isomorphic
// Tools configurations at startup
//
// Expects: Boolean
*/
verbose: true,
/*
// The react-router Routes file. Required. Will be added to Webpack aliases.
*/
routes: sourceRoot + '/routes.js',
html: {
/*
// A path to a component that provides additional DOM items to be appended
// to the <head>. Optional.
//
// Expects: String
*/
// head: sourceRoot + '/containers/Head/Head.js',
/*
// A path to a component that provides the root html shell. It is strongly
// encouraged to instead use html.head to provide your own additions, as
// with this parameter you are responsible for some of the internals of
// Universal Redux.
//
// Be sure that the content includes all of the items inside of the default
// Head and Body inside of Universal Redux's src/server directory.
//
// Expects: String
*/
// root: sourceRoot + '/containers/Root/Root.js'
},
/*
// Deprecated in favor of html.root (or html.root if
// necessary)
//
// The path to your replacement for the default HTML shell. Optional.
// If not provided, the default used will be that in src/server/html.js
//
// Expects: String
*/
// htmlShell: sourceRoot + '/containers/HtmlShell/HtmlShell.js',
redux: {
/*
// A path to an index of middleware functions. Optional.
//
// Expects: String
*/
middleware: sourceRoot + '/redux/middleware/index.js',
},
/*
// Customizations for Webpack configuration. Optional.
//
// Expects: Object
*/
webpack: {
/*
// A list of libraries that do not change frequently between deploys
// and are best served in the vendor bundle. Optional.
//
// Expects: Array
*/
// vendorLibraries: [],
/*
// Webpack configuration cusomtizations. There are more parameters
// available than specified here. For the full list, see
// https://webpack.github.io/docs/configuration.html. Optional.
//
// Expects: Object
*/
config: {
/*
// The Webpack devtool configuration. May affect build times.
// See https://webpack.github.io/docs/configuration.html#devtool
*/
devtool: isProduction ? 'source-map' : 'inline-eval-cheap-source-map'
}
}
};