turbo
b9079c9d - feat(turbopack): extend ecmatransform moduleeffect (#7213)

Commit
1 year ago
feat(turbopack): extend ecmatransform moduleeffect (#7213) Closes PACK-2356 This PR creates a new ModuleRuleEffect named `ExtendEcmascriptTransforms`. This is an extended version of `AddEcmascriptTransforms` effect, which will be removed once next.js replaces all of its references. The change born in need of allowing custom rules in `ModuleOptionContext` to have a specific order of transform. This was been achieved by having a custom ecmatransform plugin in moduleoptions. However, it was not very clear for the distinction between rules & transforms, as well as there are some behavior differences we noticed (note: this still may need to be investigated separately later). After discussing with @sokra , we concluded it is better to deprecate custom ecmatransformplugin but use custom rules whereever possible. One functional differences between current ecmatransformplugin to custom rules is custom rule always append to the main rules, so there wasn't way to adjust order of ecmatransform as we want. The change addresses that moduleeffect can specify if ecmatransform supposed to be prepended or not.
Author
Parents
Loading