fix import dev deps
This commit is contained in:
parent
00e2074f88
commit
4c9f82ea33
@ -1,5 +1,6 @@
|
||||
import webpack from "webpack";
|
||||
import config from "../config/webpack.dev.js";
|
||||
import WebpackDevServer from "webpack-dev-server";
|
||||
|
||||
const devServerConfig = {
|
||||
proxy: {
|
||||
@ -13,8 +14,7 @@ const devServerConfig = {
|
||||
},
|
||||
};
|
||||
|
||||
export default async function startFrontendDevServer(port, resolve) {
|
||||
let WebpackDevServer = (await import("webpack-dev-server")).WebpackDevServer;
|
||||
export async function startFrontendDevServer(port, resolve) {
|
||||
resolve(1);
|
||||
await new WebpackDevServer(webpack(config), devServerConfig).start(port, (err) => {
|
||||
if (err) {
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { getArgs } from "./utils.js";
|
||||
import startBackendServer from "./server-backend.js";
|
||||
import startFrontendDevServer from "./server-frontend-dev.js";
|
||||
|
||||
const SERVER_MODES = {
|
||||
PRODUCTION: 1,
|
||||
@ -21,6 +20,7 @@ if (args.mode !== "production" && args.mode !== "development") {
|
||||
const server_mode = args.mode === "production" ? SERVER_MODES.PRODUCTION : SERVER_MODES.DEVELOPMENT;
|
||||
|
||||
if (server_mode === SERVER_MODES.DEVELOPMENT) {
|
||||
let startFrontendDevServer = (await import("./server-frontend-dev.js")).startFrontendDevServer;
|
||||
console.info("Starting server in development mode.");
|
||||
startFrontendDevServer(8080, function () {
|
||||
// this time, it's the frontend server that is on port 8080
|
||||
|
Loading…
x
Reference in New Issue
Block a user