[Feature]: insert library urls into html when externals are setup #1248
Replies: 6 comments
-
This could be a useful feature, we can provide an Rsbuild plugin to implement it. Can you share the detailed plugin API design? ❤️ |
Beta Was this translation helpful? Give feedback.
-
I've just added an option example. |
Beta Was this translation helpful? Give feedback.
-
Look good to me 👍 How about maintain this plugin in a separate repo? Maybe create a new repo in https://github.com/rspack-contrib. I hope to reduce the complexity of the Rsbuild repo and hand over more non-core plugins over to the community for maintenance. |
Beta Was this translation helpful? Give feedback.
-
absolutely |
Beta Was this translation helpful? Give feedback.
-
You can give me a repo name when you are going to start the work, I will create the repo and add admin role for you. 😄 |
Beta Was this translation helpful? Give feedback.
-
I will move this issue to discussion, as this feature will be supported by a separate Rsbuild plugin. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What problem does this feature solve?
when one is setup a web app build with
externals
in it, 90% of those will typically also inject<script>
or<link>
of these external libraries into html - sometimes a set of unpkg urls, sometimes the file urls inside the public directory.in some setup, the developer would config
externals
only for production mode.The most common thing is: when bump up a dependency of this web app, most of developers bump only the dependency entity in
package.json
and forget the link in html.I previously use my own version of html-webpack-deploy-plugin to achieve it. I think rsbuild could support this feature.
pros of html-webpack-deploy-plugin:
cons:
externals
by handWhat does the proposed API look like?
An example option:
It looks very like html-webpack-deploy-plugin.
Beta Was this translation helpful? Give feedback.
All reactions