Skip to content

Instantly share code, notes, and snippets.

@ORESoftware
Created February 23, 2020 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ORESoftware/6e4a1640ad8ac49fc63dbdcf1da1fee0 to your computer and use it in GitHub Desktop.
Save ORESoftware/6e4a1640ad8ac49fc63dbdcf1da1fee0 to your computer and use it in GitHub Desktop.
Webpack middleware for loading incremental build from memory
if (!ignoreWebpack && !inProduction)
const webpack = require('webpack');
const webpackMiddleware = require('webpack-dev-middleware');
const WebpackDashboardPlugin = require('webpack-dashboard/plugin');
const config = require('./webpack.config.dev');
const compiler = webpack(config);
app.use(require("webpack-hot-middleware")(compiler));
compiler.apply(new WebpackDashboardPlugin());
app.use(webpackMiddleware(compiler, { publicPath: config.output.publicPath }));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment