@types/terser-webpack-plugin์ ์ด์ webpack ์์ฒด์์ ์์ฑ๋๋ webpack 5 ์ ํ์ ์ง์ํ์ง ์์ต๋๋ค.
node_modules/@types/terser-webpack-plugin/index.d.ts:7:10 - error TS2305: Module '"../../webpack/types"' has no exported member 'Plugin'.
7 import { Plugin } from 'webpack';
~~~~~~
@types/terser-webpack-plugin
ํจํค์ง๋ฅผ ์ฌ์ฉํด ๋ณด์๋๋ฐ ๋ฌธ์ ๊ฐ ์์์ต๋๋ค.Definitions by:
in index.d.ts
)๋ฅผ ํตํด ๋๋ตํ๋ค.@peterblazejewicz๊ฐ ์ด๋ฏธ pull ์์ฒญ์ ์์ฑํ์ต๋๋ค.
์ฐธ์กฐ: #48794.
์ด๋ ๊ฒ ํ๋ฉด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋ฉ๋๋ค.
webpack 5์ ํจ๊ป terser-webpack-plugin 5.0.0์ ์ฌ์ฉํ ๋ webpack ๊ตฌ์ฑ ํ์ผ์ ๋ ๋ค๋ฅธ ์ค๋ฅ ๋ฉ์์ง๊ฐ ๋ํ๋ฉ๋๋ค.
Type 'TerserPlugin' is not assignable to type '"..." | WebpackPluginInstance | ((this: Compiler, compiler: Compiler) => void)'.
Type 'TerserPlugin' is not assignable to type '(this: Compiler, compiler: Compiler) => void'.
Type 'TerserPlugin' provides no match for the signature '(this: Compiler, compiler: Compiler): void'.ts(2322)
์ด ๋ฌธ์ ๊ฐ ์๋ ๋ค๋ฅธ ์ฌ๋์ด ์์ต๋๊น?
๋ด๊ฐ์ด ๋ฌธ์ ๋ฅผ ๋งํ ์์๋ ๊ฒ์ ์ต์ ๋ฒ์ ์ด๋ค์์ @types/terser-webpack-plugin
ํ์๋ # 48794๋ ์ฌ์ ํ ์ง์ @types/webpack@*
์์กด๋ฟ๋งํ๋๋ก ํ์ธ [email protected]
. ์ด ์ข
์์ฑ์ package.json
์์ ์ฐพ์ ์ ์๊ธฐ ๋๋ฌธ์ @DefinitelyTyped ์ ์ํด ์์์ ์ผ๋ก ์ถ๊ฐ๋ ๊ฒ ๊ฐ์ต๋๋ค. ์ด๊ฒ์ ๋ฐฉ์งํ๊ธฐ ์ํด ์ข
์์ฑ์ผ๋ก webpack@5
๋ฅผ ์ถ๊ฐํด์ผ ํฉ๋๊น?
webpack@5
๋ ๋ ์ด์ Plugin
๋ด๋ณด๋ด์ง ์์ง๋ง ์๋ฅผ ๋ค์ด WebpackPluginInstance
์
๋๋ค.
@buschtoens
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/48857
webpack 5์์๋ ๋์ผํ ๋ฌธ์ ๊ฐ ์์์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
webpack 5์ ํจ๊ป terser-webpack-plugin 5.0.0์ ์ฌ์ฉํ ๋ webpack ๊ตฌ์ฑ ํ์ผ์ ๋ ๋ค๋ฅธ ์ค๋ฅ ๋ฉ์์ง๊ฐ ๋ํ๋ฉ๋๋ค.
์ด ๋ฌธ์ ๊ฐ ์๋ ๋ค๋ฅธ ์ฌ๋์ด ์์ต๋๊น?