Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var express = require('express');
- var webpack = require('webpack');
- var webpackDevMiddleware = require('webpack-dev-middleware');
- var app = express();
- var config = require('./webpack.config.js');
- var compiler = webpack(config);
- // Tell express to use the webpack-dev-middleware and use the webpack.config.js
- // configuration file as a base.
- app.use(webpackDevMiddleware(compiler, {
- publicPath: config.output.publicPath
- }));
- // Serve the files on port 3000.
- app.listen(3000, function () {
- console.log('Example app listening on port 3000!\n');
- });
Add Comment
Please, Sign In to add comment