Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
yuzheng14 opened this issue Oct 10, 2022 · 0 comments
Closed

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

yuzheng14 opened this issue Oct 10, 2022 · 0 comments

Comments

@yuzheng14
Copy link

例如 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就已经删除却依然存在。

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant