-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The plugin doesn't work when "preserveModules" option is enabled #29
Comments
I got it. Thanks. |
Wait! I resolved it. The build result with Here is my
|
🤔Is it because the new version of vite fixes this problem? I will try it later |
{
entry: [
// 'src/index.ts',
// 'src/common.ts',
'src/demo1/index.ts',
'src/demo2/index.ts',
],
} |
Seems you just removed two lines that I commented, I don't know how it works, maybe export default defineConfig({
build: {
lib: {
entry: [
// 'src/index.ts',
// 'src/common.ts',
'src/demo1/index.ts',
'src/demo2/index.ts',
],
},
rollupOptions: {
output: {
preserveModules: true,
},
},
},
}); |
What is the version of the Vite you used ? |
vite 5.4.10 |
Wow, I got it, there was a historical problem has been fixed accidentally by this commit 1841f44, maybe I should remove the restrictions and then support code injection when |
👍。哈哈哈,看起来是调用时机的问题,应该在 generateBundle 钩子中调用注入代码。 |
When
vite.config.ts
is as follows:There is no css injected in js bundles after build.
But if I set
build.rollupOptions.output.preserveModules
to false, it will work again.The text was updated successfully, but these errors were encountered: