turborepo
af8505ee - feat(ecmascript-plugins): support swc ecmatransform plugins (#5050)

Commit
2 years ago
feat(ecmascript-plugins): support swc ecmatransform plugins (#5050) ### Description Part 1 for WEB-998. This PR implements a new turbopack-ecmascript plugin for the swc's ecmatransform plugin. New transform `SwcEcmaTransformPluginsTransformer` accepts array of plugin module contains `CompiledPluginModuleBytes` from swc's wasm plugin then executes it. It doesn't utilize SWC's internal cache mechanism to keep compiled / serialized wasm module (`wasmer::Module`), instead expect turbopack manages it. For those reason, we only accepts `CompiledPluginModuleBytes` from swc as it is a serialized copy does not requires re-compilation, while swc have few other different representation to the module bytes. It is exposed as a separate feature instead of being default: there are some of platforms / targets we can't support plugins yet, and making it default will makes `next-swc` to fail to build. --------- Co-authored-by: Alex Kirszenberg <alex.kirszenberg@vercel.com>
Author
Parents
Loading