forked from heiseonline/embetty
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev-server.js
More file actions
executable file
路31 lines (26 loc) 路 792 Bytes
/
Copy pathdev-server.js
File metadata and controls
executable file
路31 lines (26 loc) 路 792 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
#!/usr/bin/env node
const config = require('./webpack.config')
const Embetty = require('@heise/embetty-base')
const embettyRoutes = require('@heise/embetty-server/routes')
const webpack = require('webpack')
const WebpackDevServer = require('webpack-dev-server')
const PORT = process.env.PORT || 9000
config.entry.embetty = config.entry.embetty.concat([
`webpack-dev-server/client?http://localhost:${PORT}`,
'webpack/hot/dev-server',
])
config.plugins.push(new webpack.HotModuleReplacementPlugin())
const server = new WebpackDevServer(webpack(config), {
hot: true,
compress: true,
contentBase: './example',
before: app => {
app.set('embetty', new Embetty())
app.use(embettyRoutes)
},
disableHostCheck: true,
stats: {
colors: true
},
})
server.listen(PORT)