Asset management for libraries? #19414
Unanswered
filimon-danopoulos-stratsys
asked this question in
Q&A
Replies: 1 comment 2 replies
-
What do you mean? Do you want analizable ESM output, so webpack again can understand about this file? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have multiple applications written in Vue that are distributed as NPM-packages. These are consumed by a host that manages the final build with Webpack.
When building the Vue-apps with Webpack (in library mode with ESM output) I use
experiments: { css: true }
so I get a CSS-file as part of the output. I need to make the second Webpack build in the host aware of this non-ESM asset so that it is included in the final build.The same thing applies to other non-ESM assets too like SVGs. What is the best way to solve this issue 2025? I'm not necesarily looking for an out-of-the-box solution but I want something that scales and is not dependent on manual mapping.
The best I can think of myself is generating a manifest with
webpack-assets-manifest
orwebpack-manifest-plugin
and somehow use them in the host build to automatically copy these files to the output folder. However in this instance I would get a CSS-file per Vue app so the integration does not really optimize CSS all that well.Any other suggestion or help is greatly appreciated. 😀
Beta Was this translation helpful? Give feedback.
All reactions