Closed
Description
When using this plugin inside of a webpack.config.ts
I have to do something along the lines of
import _ResolveTypeScriptPlugin from 'resolve-typescript-plugin';
// @ts-ignore
const ResolveTypeScriptPlugin = _ResolveTypeScriptPlugin.default;
as doing both
import ResolveTypeScriptPlugin from 'resolve-typescript-plugin';
and
import * as ResolveTypeScriptPlugin from 'resolve-typescript-plugin';
result in
[webpack-cli] Failed to load '/home/cobertos/Seafile/projects/mapcast/monorepo/pkg/app-auctions/webpack.config.ts' config
[webpack-cli] webpack.config.ts:85:19 - error TS2351: This expression is not constructable.
Type 'typeof import("/home/cobertos/Seafile/projects/mapcast/monorepo/node_modules/resolve-typescript-plugin/index")' has no construct signatures.
85 plugins: [new ResolveTypeScriptPlugin()]
~~~~~~~~~~~~~~~~~~~~~~~
I think this is because the built index.js
is using?
Object.defineProperty(exports, "__esModule", { value: true });
//...
exports.default = ResolveTypescriptPlugin;
instead of commonjs module.exports
or ESM export default ...
.