본문 바로가기
개발 관련 개념들

npm run build시 html-webpack-plugin 에러

by 코곰 2021. 4. 14.
Error: html-webpack-plugin could not minify the generated output.
  In production mode the html minifcation is enabled by default.
  If you are not generating a valid html output please disable it manually.
  You can do so by adding the following setting to your HtmlWebpackPlugin config:
  |
  |    minify: false
  |
  See 
https://github.com/jantimon/html-webpack-plugin#options
 for details.

 

npm run build를 했는데 위와 같은 에러가 났다!

 

검색을 했더니

github.com/jantimon/html-webpack-plugin/issues/1368

 

No quotes for base64 images, which causes errors when using minify · Issue #1368 · jantimon/html-webpack-plugin

Current behaviour I use url-loader and html-loader to process images referenced in html, Packaging error, Obviously, base64 images are not wrapped in quotes。 ERROR in Error: html-webpack-plugin cou...

github.com

위와 같은 스레드가 나왔고,

href 주변에 오타가 있을 가능성에 href를 키워드로 찾아봤다.

 

실제로 아래와 같은 오타가 있었고,

 

태그를 잘 닫아주니 build가 제대로 됐다!

 

프로젝트를 build할 때, html를 압축 (html minify)하기위해 웹팩이 html-loader로 읽어들이는데, 

loader가 오타 때문에 제대로 읽어들이 지 못해 발생했던 에러이다!

댓글