Skip to content

5.74.0的文档中的devServer和英文文档不对应 #1705

Closed
@yuzheng14

Description

@yuzheng14

例如 overlay 这个属性
中文文档里是 devServer.overlay
官方文档里是 devServer.client.overlay

中文文档

devServer.overlay

boolean` `object

Shows a full-screen overlay in the browser when there are compiler errors or warnings. Disabled by default. If you want to show only compiler errors:

overlay: true

If you want to show warnings as well as errors:

overlay: {
  warnings: true,
  errors: true
}

官方文档

overlay

boolean = true` `object: { errors boolean = true, warnings boolean = true }

Shows a full-screen overlay in the browser when there are compiler errors or warnings.

webpack.config.js

module.exports = {
  //...
  devServer: {
    client: {
      overlay: true,
    },
  },
};

Usage via the CLI:

npx webpack serve --client-overlay

To disable:

npx webpack serve --no-client-overlay

If you want to show only errors:

webpack.config.js

module.exports = {
  //...
  devServer: {
    client: {
      overlay: {
        errors: true,
        warnings: false,
      },
    },
  },
};

Usage via the CLI:

npx webpack serve --client-overlay-errors --no-client-overlay-warnings

还有 inline 属性在 v4就已经删除却依然存在。

此外还有很多都和官方文档不同

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions