File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
packages/repack/src/loaders/babelSwcLoader Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @callstack/repack " : patch
3+ ---
4+
5+ Let SWC handle ` transform-typescript ` when using ` babel-swc-loader `
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ const SWC_SUPPORTED_CUSTOM_RULES = new Set([
4141 'transform-react-jsx' ,
4242 'transform-modules-commonjs' ,
4343 'proposal-export-default-from' ,
44+ 'transform-typescript' ,
4445 'transform-dynamic-import' ,
4546] ) ;
4647
@@ -241,6 +242,13 @@ function getTransformForOfConfig(
241242 } ;
242243}
243244
245+ function getTransformTypescriptConfig (
246+ swcConfig : SwcLoaderOptions
247+ ) : SwcLoaderOptions {
248+ // passthrough
249+ return swcConfig ;
250+ }
251+
244252const SWC_SUPPORTED_CONFIGURABLE_RULES_MAP = {
245253 'transform-class-properties' : getTransformClassPropertiesConfig ,
246254 'transform-private-methods' : getTransformPrivateMethodsPropertyConfig ,
@@ -261,6 +269,7 @@ const SWC_SUPPORTED_CUSTOM_RULES_MAP = {
261269 'transform-react-jsx-source' : getTransformReactDevelopmentConfig ,
262270 'transform-modules-commonjs' : getTransformModulesCommonjsConfig ,
263271 'proposal-export-default-from' : getTransformExportDefaultFromConfig ,
272+ 'transform-typescript' : getTransformTypescriptConfig ,
264273 'transform-dynamic-import' : getTransformDynamicImportConfig ,
265274} ;
266275
You can’t perform that action at this time.
0 commit comments