Webpacker: Change to Using swc with webpack (It's 16x faster than babel.)

Created on 13 Apr 2019  路  2Comments  路  Source: rails/webpacker

I read about SWC at https://swc-project.github.io/

It support webpack with https://swc-project.github.io/docs/usage-swc-loader

I thinks webpack should replace babel with swc.

Most helpful comment

Sprockets used to rely on a factory pattern that allowed to switch between different javascript runtimes via execjs. I believe here is a perfect situation where we could do the same thing and allow to switch between different transpiller implementations.

All 2 comments

This will download prebuilt binary instead of building swc if possible. To use swc in other environments, you should install nightly version of rust first. It can be done with curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=nightly

Not sure too many people would be happy about depending on yet another language. It could work.

Sprockets used to rely on a factory pattern that allowed to switch between different javascript runtimes via execjs. I believe here is a perfect situation where we could do the same thing and allow to switch between different transpiller implementations.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amandapouget picture amandapouget  路  3Comments

eriknygren picture eriknygren  路  3Comments

ytbryan picture ytbryan  路  3Comments

towry picture towry  路  3Comments

itay-grudev picture itay-grudev  路  3Comments