build-plugin icon indicating copy to clipboard operation
build-plugin copied to clipboard

Compiler type doesn't match webpack Compiler type

Open igoldny opened this issue 1 year ago • 0 comments

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);

Additional context

igoldny avatar Aug 17 '23 15:08 igoldny