diff --git a/client/config/webpackDevServer.config.ts b/client/config/webpackDevServer.config.ts index dff9ea177a..58dc2d92d4 100644 --- a/client/config/webpackDevServer.config.ts +++ b/client/config/webpackDevServer.config.ts @@ -69,7 +69,7 @@ export default function ({ publicPath, // WebpackDevServer is noisy by default so we emit custom message instead // by listening to the compiler events with `compiler.plugin` calls above. - quiet: true, + quiet: false, // Reportedly, this avoids CPU overload on some systems. // https://github.com/facebookincubator/create-react-app/issues/293 // src/node_modules is not ignored to support absolute imports @@ -82,7 +82,8 @@ export default function ({ disableDotRule: true, rewrites: [], }, - public: allowedHost, + allowedHosts: ["127.0.0.1:8080", "127.0.0.1:3000"], + public: "127.0.0.1:8080", index: "embed.html", sockPort: devPort, proxy: [ @@ -105,7 +106,7 @@ export default function ({ "/graphiql", ].some((p) => p === lc || lc.startsWith(`${p}/`)); }, - target: `http://localhost:${serverPort}`, + target: `127.0.0.1:${serverPort}`, onError: (err, req, res) => { res.writeHead(500, { "Content-Type": "text/html", diff --git a/client/scripts/start.ts b/client/scripts/start.ts index 26656a4678..348b4dc2bb 100644 --- a/client/scripts/start.ts +++ b/client/scripts/start.ts @@ -1,19 +1,18 @@ #!/usr/bin/env ts-node -import dotenv from "dotenv"; - -// Apply all the configuration provided in the .env file if it isn't already in -// the environment. -dotenv.config(); - import chalk from "chalk"; +import dotenv from "dotenv"; import webpack from "webpack"; import WebpackDevServer from "webpack-dev-server"; -import { createCompiler, prepareUrls } from "./WebpackDevServerUtils"; import createDevServerConfig from "../config/webpackDevServer.config"; import config from "../src/core/build/config"; import createWebpackConfig from "../src/core/build/createWebpackConfig"; +import { createCompiler, prepareUrls } from "./WebpackDevServerUtils"; + +// Apply all the configuration provided in the .env file if it isn't already in +// the environment. +dotenv.config(); /* eslint-disable no-console */ @@ -32,6 +31,7 @@ process.on("unhandledRejection", (err) => { }); const PORT = config.get("dev_port"); +const SERVER_PORT = 3000; const HOST = "0.0.0.0"; if (process.env.HOST) { @@ -78,7 +78,7 @@ const compiler = createCompiler({ // Serve webpack assets generated by the compiler over a web sever. const serverConfig = createDevServerConfig({ allowedHost: urls.lanUrlForConfig, - serverPort: config.get("port"), + serverPort: SERVER_PORT, devPort: PORT, publicPath: webpackConfig[0].output!.publicPath!, }); @@ -94,9 +94,7 @@ devServer.listen(PORT, HOST, (err: Error) => { return console.log(err); } console.log(chalk.cyan("Starting the development server...\n")); - console.log( - chalk.yellow(`devPort: ${PORT}, serverPort: ${serverConfig.port}`) - ); + console.log(chalk.yellow(`devPort: ${PORT}, serverPort: ${SERVER_PORT}`)); }); ["SIGINT", "SIGTERM"].forEach((sig: any) => { diff --git a/client/src/core/client/embed/amp.html b/client/src/core/client/embed/amp.html index 6dfe2c1d5c..1e361ef214 100644 --- a/client/src/core/client/embed/amp.html +++ b/client/src/core/client/embed/amp.html @@ -16,7 +16,7 @@