only import webpack-dev-server in dev mode

This commit is contained in:
Raphael 2024-05-07 11:31:39 +02:00
parent d73d9a3ee6
commit 00e2074f88

View File

@ -1,5 +1,4 @@
import webpack from "webpack";
import WebpackDevServer from "webpack-dev-server";
import config from "../config/webpack.dev.js";
const devServerConfig = {
@ -15,6 +14,7 @@ const devServerConfig = {
};
export default async function startFrontendDevServer(port, resolve) {
let WebpackDevServer = (await import("webpack-dev-server")).WebpackDevServer;
resolve(1);
await new WebpackDevServer(webpack(config), devServerConfig).start(port, (err) => {
if (err) {