@source should support @import-like package references #18587
Replies: 2 comments 2 replies
-
While I understand the idea, I don't really like your v3 JavaScript solution anyway. I assume the location of your node_modules folder has never changed, so it's more complicated than just using a simple static string. And while it's frustrating that this approach still isn't available in |
Beta Was this translation helpful? Give feedback.
-
The solution that I would recommend is putting the /* @org/component-library/index.css */
@source "./src"; /* or whatever */ /* app-a/styles.css */
@import "@org/component-library"; Then just make sure you add This is how we intended people to use this feature for sure, works better when |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
In our micro-frontend monorepo setup, we build our component library's -- a separate npm package -- styles as part of a micro-frontend's build process. We are currently migrating to v4 and found out we need to use the
@source
directive to include external source files. However it doesn't seem to support the same syntax for referencing packages that@import
does:And instead we need to use relative paths to
node_modules
directory:This becomes annoying when our micro-frontends might be using different versions of the component-library package, as with
pnpm
the package might be installed into the rootnode_modules
or the workspace'snode_modules
. Each micro-frontend will need to know is their exact version living in the root or the workspace -- developers will forget about this tiny detail causing wrong versions of the library to be built. Optimally each micro-fe would have the exact same newest version of the library but this is likely not going to be the reality.In v3 we have handled this in
tailwind.config.js
rather nicely:Are we doing this horribly wrong, is there another workaround or would such feature to
@source
make sense?Beta Was this translation helpful? Give feedback.
All reactions