UNPKG

mobx--awesome-connect

Version:

Not official React bindings for mobX, but performant and flexible

39 lines (33 loc) 966 B
// import path from 'path'; // import webpack from 'webpack'; // import webpackDevMiddleware from 'webpack-dev-middleware'; // import config from './webpack.config.dev'; // import Express from 'express'; var path = require('path'); var webpack = require('webpack'); var webpackDevMiddleware = require('webpack-dev-middleware'); var config = require('./webpack.config.dev'); var Express = require('express'); const app = new Express(); const port = 3000; const compiler = webpack(config); app.use(webpackDevMiddleware(compiler, { noInfo: true, publicPath: config.output.publicPath, })); app.get('/*', (req, res) => { res.sendFile(path.join(__dirname, 'index.html')); }); app.listen(port, error => { /* eslint-disable no-console */ if (error) { console.error(error); } else { console.info( '🌎 Listening on port %s. Open up http://localhost:%s/ in your browser.', port, port ); } /* eslint-enable no-console */ });