Reactでrequireしてたら、[BABEL] Note: The code generator has deoptimised the styling of

Reactでrequireしてたら、[BABEL] Note: The code generator has deoptimised the styling of

Read in: en
Reactでrequireしてたら、[BABEL] Note: The code generator has deoptimised the styling of

ReactでComponentをrequireしてたら見慣れないエラーがでました。

環境

ファイルでかいぞ!

[BABEL] Note:The code generator has deoptimised the styling of "D:/path/to/hoge.js" as it exceeds the max of "100KB"

というエラーなわけですが、babelを使っていてファイルが大きすぎると発生するエラーのようです。

What does “The code generator has deoptimised the styling of [some file] as it exceeds the max of ”100KB“” mean?

特に気にすることはないみたいですが、警告を非表示にしたいのであれば、babelのcompactというoptionをfalseにすればいいみたいです。

Laravel-Elixirのbrowserifyを使った時のbabelのpluginsの編集方法

これはpluginsの編集方法についてですが、optionに関しても参考になるかと思います。

しかし警告を消してしてもファイルは大きいままなので、ファイルを圧縮させることで対応しました。

gulp --production

optionの変更の仕方がよくわからなかったですヽ(´ー`)ノ

Tags: React Tips
Share: 𝕏 Post Facebook Hatena
✏️ View source / Discuss on GitHub
☕ サポート

このブログを応援していただける方は、以下からサポートをお願いします。いただいたサポートはブログ運営・技術研鑽に活用します。


関連記事