yarn run v1.22.21
$ vue-tsc --declaration --emitDeclarationOnly
node_modules/terser-webpack-plugin/types/index.d.ts:5:39 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("terser")' call instead.
5 declare class TerserPlugin<T = import("terser").MinifyOptions> {
~~~~~~~~
node_modules/terser-webpack-plugin/types/index.d.ts:184:17 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("terser")' call instead.
184 ecma?: import("terser").ECMA | undefined;
~~~~~~~~
node_modules/terser-webpack-plugin/types/utils.d.ts:3:42 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("terser")' call instead.
3 export type TerserFormatOptions = import("terser").FormatOptions;
~~~~~~~~
node_modules/terser-webpack-plugin/types/utils.d.ts:4:36 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("terser")' call instead.
4 export type TerserOptions = import("terser").MinifyOptions;
~~~~~~~~
node_modules/terser-webpack-plugin/types/utils.d.ts:5:44 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("terser")' call instead.
5 export type TerserCompressOptions = import("terser").CompressOptions;
~~~~~~~~
node_modules/terser-webpack-plugin/types/utils.d.ts:6:33 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("terser")' call instead.
6 export type TerserECMA = import("terser").ECMA;
~~~~~~~~
Found 6 errors in 2 files.
Errors Files
2 node_modules/terser-webpack-plugin/types/index.d.ts:5
4 node_modules/terser-webpack-plugin/types/utils.d.ts:3
error Command failed with exit code 2.
Bug report
I wrote my Webpack config in TypeScript. After I was calling
vue-tsc
6 terser plugin errors appears.Actual Behavior
6 Erros
Expected Behavior
0 Erros
How Do We Reproduce?
That is the part of my Webpack configuration, which throws the only 6 errors I have. https://github.com/dark-kitt/wordpress-theme-vue/blob/main/configs/webpack.optimization.ts
Please paste the results of
npx webpack-cli info
here, and mention other relevant informationCurrent errors