A better dev server.
Features:
- Run server-side node applications in development mode.
- Parallelized builds for multi-webpack configurations.
- Universal, detachable IPC.
- Simple, dynamic proxying.
- Host multiple applications at once.
IMPORTANT: We're not super battle-tested. Use at your own risk. The current version is a fairly major rewrite and while the external API you use for spawning the server hasn't changed much for the typical use case, a lot of stuff has changed.
#!/bin/sh
luminol -c client.webpack.config.js -c server.webpack.config.js
import {createServer} from 'luminol';
import {compose, get, send} from 'midori';
const server = createServer({
port: 3030,
clipboard: true,
hot: true,
http2: false,
https: false,
logLevel: 'debug',
open: false,
config: [
'./webpack.config.js',
],
add: (app) => {
return compose(
get('/status', send('OK')),
app,
);
},
});
// Bind to server.
server.on('listening', () => {
console.log(`Listening on ${server.address().port}`);
});