-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathentry.js
More file actions
33 lines (29 loc) · 782 Bytes
/
entry.js
File metadata and controls
33 lines (29 loc) · 782 Bytes
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
const path = require('path')
function client(options) {
if (options.environment === 'production') {
return options.entry
}
return [
`${require.resolve('webpack-hot-middleware/client')}?log=false&path=/nullstack/hmr&noInfo=true&quiet=true&timeout=1000&reload=true`,
path.posix.join(options.configFolder, 'shared', 'accept.js'),
options.entry
]
}
function server(options) {
if (options.environment === 'production') {
return options.entry
}
return [
`${require.resolve('webpack/hot/poll')}?100`,
path.posix.join(options.configFolder, 'shared', 'accept.js'),
options.entry
]
}
function entry(options) {
if (options.target == 'client') {
return client(options)
} else {
return server(options)
}
}
module.exports = entry