build-plugin
build-plugin copied to clipboard
Compiler type doesn't match webpack Compiler type
Describe what happened
Would like to include build-plugin inside my internal webpack plugin.
I use webpack and am trying to pass webpack compiler into BuildPlugin
but the types do not match.
Steps to reproduce the issue:
Pass webpack compiler to apply
will throw TS error:
import type { Compiler } from 'webpack';
new BuildPlugin().apply(compiler as Compiler);
Expected behaviour:
import type { Compiler } from 'webpack';
new BuildPlugin().apply(compiler as Compiler);
Actual behaviour:
import { Compiler as BuildPluginCompiler } from '@datadog/build-plugin/dist/types';
new BuildPlugin().apply(compiler as unknown as BuildPluginCompiler);