0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ng build --prod で abort が発生した困った場合

Last updated at Posted at 2020-03-27

同様の現象に会う人はあまりいないと思われるけどメモがてら。
Angular の開発にて「よっしゃー仕上げじゃー」と思って意気揚々と

ng build --prod

をやると

92% chunk asset optimization TerserPlugin
abort

的な感じでコンパイル出来ないので愕然となる。

を斜め読みするとどうもメモリ周りのエラーの模様。が、よくわからんので途方に暮れつつ情報を漁る。

を見ると

update to node v13.8.0 solved the issue for me

ということで node のバージョンをあげることで解決するということなので使っていた node のバージョンが v10.15.3 だったので最新版の v13.12.0 に入れて実行したとろこ無事該当エラー箇所は通過。ふぅ、やれやれだぜ。とか思ってると最後に Budgets のエラーが。またしても愕然としたものの

にて angular.json の該当箇所を変更すればエラーは一応解消される(アプリケーションサイズの警告らしいので適当な値設定するのは微妙だなと思いつつ)。

今回の TerserPlugin の問題とは別に prod ビルドは「この ts ファイル何処も使ってないけどなんであるの?ちょっとうざいんですけど。」的な感じ(誇張)で容赦なく的確にご指摘してくれるのでやったほうが良いぞなもし。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?