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
CSS does not generate in iife
build
#1077
Comments
Emm why do you want the css string in runtime? |
This is for demonstration purposes, not for anything else |
If you look at unoCSS compiled CSS, you will find that there is no valid CSS in the packaged compilation |
We are deploying https://uno.antfu.me/ with the latest UnoCSS and we never faced such regression. Please provide a minimal reproduction, thanks. |
According to my test: Find the problem, but not sure how to fix it export default defineConfig({
base: "./",
plugins: [vue(), Unocss()],
build: {
rollupOptions: {
// !The problem was changing format to Iife
output: { format: "iife", inlineDynamicImports: true },
},
},
}); |
iife
build
I also have this problem when set output format to export default defineConfig({
base: "./",
plugins: [vue(), Unocss()],
build: {
rollupOptions: {
output: { format: 'umd' }
},
},
}); |
CSS is bundled into js when format are unocss/packages/vite/src/modes/global/build.ts Lines 148 to 154 in 1000830
Should we try to check for js when css doesn't exist at |
Mode Dev: The normal display
Mode Prod: The CSS cannot be obtained
main.ts
vite.config.ts
The text was updated successfully, but these errors were encountered: