You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, to utilize the builtin:swc-loader transformation capability in rspack, a complete rspack bundling compilation is required.
If rspack provides a standalone transform API, it can be used directly to invoke rspack's builtin:swc-loader for some file transformations.
Potential scenarios:
Loading of some configuration files. When rsbuild loads the configuration file, it needs to transform the configuration file from typescript to javascript.
Rslib's bundleless scenario, currently requires a complete rspack compilation. However, it seems that only rspack's resolve and transform capabilities are needed.
What does the proposed API of configuration look like?
It may be an API on the rspack instance that reads rspack's configuration. Or a util method that calls rspack builtin:swc-loader alone.
9aoy
changed the title
[Feature]: Support run builtin:swc-loader via a standalone API
[Feature]: Support run swc transform via a standalone API
Jan 13, 2025
chenjiahan
changed the title
[Feature]: Support run swc transform via a standalone API
[Feature]: Support run SWC transform via a standalone API
Jan 13, 2025
import{rspack}from'@rspack/core';rspack.util.swc.transform("source code",{// some options});rspack.util.swc.parse("source code",{// some options});rspack.util.swc.minify("source code",{// some options});
What problem does this feature solve?
Currently, to utilize the
builtin:swc-loader
transformation capability in rspack, a complete rspack bundling compilation is required.If rspack provides a standalone transform API, it can be used directly to invoke rspack's
builtin:swc-loader
for some file transformations.Potential scenarios:
What does the proposed API of configuration look like?
It may be an API on the rspack instance that reads rspack's configuration. Or a util method that calls rspack
builtin:swc-loader
alone.or
The text was updated successfully, but these errors were encountered: