mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-28 10:10:20 +02:00
29 lines
677 B
JavaScript
29 lines
677 B
JavaScript
|
"use strict";
|
||
|
|
||
|
module.exports = (app) => {
|
||
|
const log = require("../log");
|
||
|
|
||
|
log.debug("Starting server in development mode");
|
||
|
|
||
|
const webpack = require("webpack");
|
||
|
const webpackConfig = require("../../webpack.config.js");
|
||
|
|
||
|
webpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin());
|
||
|
webpackConfig.entry["js/bundle.js"].push(
|
||
|
"webpack-hot-middleware/client?path=storage/__webpack_hmr"
|
||
|
);
|
||
|
|
||
|
const compiler = webpack(webpackConfig);
|
||
|
|
||
|
app.use(
|
||
|
require("webpack-dev-middleware")(compiler, {
|
||
|
index: "/",
|
||
|
publicPath: webpackConfig.output.publicPath,
|
||
|
})
|
||
|
).use(
|
||
|
require("webpack-hot-middleware")(compiler, {
|
||
|
path: "/storage/__webpack_hmr",
|
||
|
})
|
||
|
);
|
||
|
};
|