only import webpack-dev-server in dev mode
This commit is contained in:
parent
d73d9a3ee6
commit
00e2074f88
@ -1,5 +1,4 @@
|
|||||||
import webpack from "webpack";
|
import webpack from "webpack";
|
||||||
import WebpackDevServer from "webpack-dev-server";
|
|
||||||
import config from "../config/webpack.dev.js";
|
import config from "../config/webpack.dev.js";
|
||||||
|
|
||||||
const devServerConfig = {
|
const devServerConfig = {
|
||||||
@ -15,6 +14,7 @@ const devServerConfig = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default async function startFrontendDevServer(port, resolve) {
|
export default async function startFrontendDevServer(port, resolve) {
|
||||||
|
let WebpackDevServer = (await import("webpack-dev-server")).WebpackDevServer;
|
||||||
resolve(1);
|
resolve(1);
|
||||||
await new WebpackDevServer(webpack(config), devServerConfig).start(port, (err) => {
|
await new WebpackDevServer(webpack(config), devServerConfig).start(port, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user