Replies: 3 comments 1 reply
-
You can write a plug-in yourself. E.g {
name:'injectCode',
transform(code, id) {
if (id ==='xxxx/src/main.js') {
const injectCode ='xxx';
// Processed code
return processCode;
}
return code;
},
}; |
Beta Was this translation helpful? Give feedback.
1 reply
-
You can provide configuration information to allow users to configure the entry file address |
Beta Was this translation helpful? Give feedback.
0 replies
-
Anyone have an answer to this? I wanted to make an all-in-one plugin that automatically imports an |
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've seen many plugins like vite-plugin-windicss have the style of installation steps like this:
step 1. install in the
vite.config.js
step 2. install in the
main.js
where [step 2] is completed redundant..
Wouldn't it be better to just inject the
import 'virtual:windi.css'
automatically..?I'm looking for the recommended way to inject js code into the
main.js
, any suggestions?Beta Was this translation helpful? Give feedback.
All reactions