Replies: 1 comment
-
in build mode, I make it work by another plugin
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been working for several days on porting a web project into a Chrome extension, which, as a result, allows the web project to run in the form of the extension's options page.
However, the web project currently relies on some CDN-hosted JavaScript sources, which is not a standard practice for Chrome extensions. Significant work will be required: downloading the CDN-hosted JavaScript files, adding them to the project, and updating the HTML script links accordingly.
For example, the original
index.html
file looks like this:After some necessary work, there will be a newly created file such as
/chunks/tex-svg-{hash}.js
, and the code lines inindex.html
will change to:However, it is possible to achieve this functionality using a Vite plugin, so you do not need to modify the web project's source code directly.
Fortunately, I have successfully implemented this approach in development server mode by using virtual files to mimic certain functionalities from the devPrerenderHtml plugin of the wxt project.
Beta Was this translation helpful? Give feedback.
All reactions