[Bug]: output.copy
type definition is limited to CopyRspackPluginOptions
#5610
Labels
bug
Something isn't working
Version
Details
Our configuration is using Webpack to produce a static SPA.
v5.0.4
The documentation for
output.copy
outlines, correctly, that the Modern.js copy should accept the same configuration as thecopy-webpack-plugin
. However, the type definition for this property is limited to theCopyRspackPluginOptions
type.The property that's throwing the error is the
transform
property. We're using Webpack to bundled our application, so the feature does work correctly. Only the type checking is incorrect.Below is the type error thrown:
Relevant portion of the
modern.config.ts
:Reproduce link
https://gitpod.io#snapshot/7df64c15-a5f8-4d0c-ac1a-9702097a7ebe
Reproduce Steps
In the shared Gitpod snapshot: https://gitpod.io#snapshot/7df64c15-a5f8-4d0c-ac1a-9702097a7ebe
Code is on GitHub if you don't want to use Gitpod: https://github.com/AllenAttuned/modern_ts_bug
You'll find the
modern.config.js
file. In it, I've added theoutput.copy
property with thetransform
property. Runningnpm run build
as is will fail with the type error. Removing the whitespace between the@
andts-expect-error
in the TypeScript exception will allow the build to succeed.The text was updated successfully, but these errors were encountered: