Plugin API: Type definition of configureWebpack
does allow all possible keys
#9654
Open
7 tasks done
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
The type definition for
configureWebpack
in the plugins API currently uses theConfiguration
type from webpack:docusaurus/packages/docusaurus-types/src/plugin.d.ts
Lines 125 to 130 in affca7a
When I return an object containing a
devServer
key, this works as expected, but I get a type error because theConfiguration
type doesn't contain a key calleddevServer
.As far as I can tell, from some very uninformed searching, I think the type that this should actually be is https://github.com/webpack/webpack/blob/main/declarations/WebpackOptions.d.ts#L797.
Reproducible demo
https://codesandbox.io/p/sandbox/docusaurus-webpack-devserver-tqk8nr
Steps to reproduce
plugins
redirectPlugin
Expected behavior
I expect
docusaurus.config.ts
to type check successfully whendevServer
is configuredActual behavior
I get a type error in
docusaurus.config.ts
whendevServer
is configured, yet it definitely behaves as I expectYour environment
No response
Self-service
The text was updated successfully, but these errors were encountered: