Webpack dev server URL should be displayed more prominently

オープン
#4,907 コメント 7 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@snitin315 がすでに取り組んでいます。

2024年9月16日 から。

  • #5489 @HTGA75 による — オープン

評価

この issue はまだ評価されていません。

説明

Feature Proposal

I work in a large monorepo, so when I launch the Webpack dev server, the localhost URL is unpredictable. Different apps may use different ports.

Webpack helpfully prints the URL into the console log, so that you can easily click on it to launch the Chrome web browser. It looks like this:

image

Currently this message is only printed once. After several incremental rebuilds, the message scrolls off the screen and gets lost. The workaround is to kill and restart the dev server, but for large projects this can mean waiting several minutes for initialization.

Suggested improvement: After every incremental rebuild, print the URL last.

How should this be implemented

A minor change to the logging code:

webpack-dev-server/lib/Server.js

    if (this.options.ipc) {
      this.logger.info(
        `Project is running at: "${
          /** @type {import("http").Server} */
          (this.server).address()
        }"`
      );
    } else {
      const protocol =
        /** @type {ServerConfiguration} */
        (this.options.server).type === "http" ? "http" : "https";
      const { address, port } =
        /** @type {import("net").AddressInfo} */
        (
          /** @type {import("http").Server} */
          (this.server).address()
        );
Feature Use Case

This change would make Webpack Dev Server easier to use.

Please paste the results of npx webpack-cli info here, and mention other relevant information
  System:
    OS: Windows 10 10.0.22621
    Memory: 3.51 GB / 12.29 GB
  Binaries:
    Node: 16.15.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
    npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 114.0.5735.134
    Edge: Spartan (44.22621.1848.0), Chromium (114.0.1823.41)
    Internet Explorer: 11.0.22621.1
主要言語
JavaScript
スター
7.9k
フォーク
1.5k
平均マージ
2日 12時間
マージ済み PR(30日)
8

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

webpack/webpack-dev-server のほかの issue

webpack/webpack-dev-server の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。