Replies: 8 comments
-
How is it current status ? mate @makezi |
Beta Was this translation helpful? Give feedback.
-
It's can help with import |
Beta Was this translation helpful? Give feedback.
-
Any responses? |
Beta Was this translation helpful? Give feedback.
-
Hi @leerob , how convenient would this be to be implemented ? Does this need any changes under the hood in swc-core ? |
Beta Was this translation helpful? Give feedback.
-
Any update on update on this? any workaround? |
Beta Was this translation helpful? Give feedback.
-
Was looking for this thread since I'm trying to solve a use case with components tree shaking for RSC which works well with modularizeImports. However in my case, import paths are not the same for everything. For example, you can import components and hooks that reside in different folders. So having more control over resolving would be very helpful for handling this. |
Beta Was this translation helpful? Give feedback.
-
I've managed to make use of babel-plugin-transform-imports and still use swc, using babel-loader. The compile time may be slower. I don't know if this is a good approach, but it seems to work. This is my next config:
|
Beta Was this translation helpful? Give feedback.
-
To all people coming across this topic. There is optimizePackageImports now. |
Beta Was this translation helpful? Give feedback.
-
Describe the feature you'd like to request
From #34969, it would be great if it were possible to allow the transformer to allow functions (similar to that of function transformer from babel-plugin-transform-imports).
Right now, I'm trying to import a react component library that uses hyphen-case as its naming convention and currently there is no way of doing so - there's only helpers for uppercase, lowercase and camel case. An example import:
Describe the solution you'd like
Either one of two solutions:
hypenCase
helper to the handlebars transform function similar to that of the other provided helpersm i.e.@our-design-system/dist/components/{{ hypenCase member}}
. Although this doesn't give us enough power of the transformations compared to option 2.transform
to accept a function similar to that from babel-plugin-transform-imports)Describe alternatives you've considered
The only other solution is to just defer back to
babel.config.js
and use babel plugins.Beta Was this translation helpful? Give feedback.
All reactions