-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
esbuild導入検討 #27
Comments
esbuild-loaderはReactの自動インポートに対応していないため、ProvidePluginで挿入する必要がある。 const { ProvidePlugin } = require('webpack')
const webpackConfig = {
plugins: [
new webpack.ProvidePlugin({
React: "react"
})
]
}
module.exports = webpackConfig |
esbuildには公式のコンフィグファイルがないので、設定のオーバーライドについて考える必要がある。
暫定的に非公式の esbuildを使う場合は、条件分岐でbabel-loader + ts-loaderの設定をオフにしないとならない。派生プラグインを作って、それがインストールされている場合は 切り替えるなどの方法が考えられる。 |
現在の制作でビルド速度がそこまでボトルネックになっていないため保留とする。速度を重視するのであれば、Viteなどの爆速バンドラーベースの新構成に時間を割いた方が良いと考える。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Viteなどに比べるとwebpackの遅さが気になるので、なるべく高速化したい。
esbuild-loaderをbabel-loader + ts-loaderの場合と比較したところ、3〜4割ほど速くなった。
※別件でswc-loaderを検証したときはと1割高速化
仕組み上、爆速とまではいかなかったが導入してみたい。そのまま差し替えるとbabel-loader + ts-loaderを使っているプロジェクトとの互換性問題や新たな不具合が心配なので、CLIオプションで使用できると良いかもしれない。
The text was updated successfully, but these errors were encountered: