검색결과 리스트
글
LANGUAGE/!$%!% ERROR NOTE
2019. 7. 27. 14:03
Webpack - 웹팩
Error - 오류
Error: clean-webpack-plugin only accepts an options object. See:
https://github.com/johnagan/clean-webpack-plugin#options-and-defaults-optional
at new CleanWebpackPlugin (..client\node_modules\clean-webpack-plugin\dist\clean-webpack-plugin.js:27:13)
at module.exports (..client\webpack.config.js:571:21)
at handleFunction (..client\node_modules\webpack-cli\bin\utils\prepareOptions.js:21:13)
at prepareOptions (..client\node_modules\webpack-cli\bin\utils\prepareOptions.js:9:5)
at requireConfig (..client\node_modules\webpack-cli\bin\utils\convert-argv.js:119:14)
at ..client\node_modules\webpack-cli\bin\utils\convert-argv.js:125:17
at Array.forEach (<anonymous>)
at module.exports (..client\node_modules\webpack-cli\bin\utils\convert-argv.js:123:15)
at yargs.parse (..client\node_modules\webpack-cli\bin\cli.js:71:45)
at Object.parse (..client\node_modules\webpack-cli\node_modules\yargs\yargs.js:567:18)
at ..client\node_modules\webpack-cli\bin\cli.js:49:8
at Object.<anonymous> (..client\node_modules\webpack-cli\bin\cli.js:365:3)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
Problem - 문제
엉겁결에 CleanWebpackPlugin를 업그레이드 시켰더니 문제가 발생했다.CleanWebpackPlugin 3.0.0
부터 다루는 법이 조금 바뀌었다.
Solved - 해결
-
BEFORE
new CleanWebpackPlugin(['dist'], {}),
-
AFTER
new CleanWebpackPlugin(),
Reference - 참고
- clean-webpack-plugin only accepts an options object: https://stackoverflow.com/questions/55190450/clean-webpack-plugin-only-accepts-an-options-object