Skip to content

Vite 打包 vue 的时候,如何把所有css打包到一个文件中 #3203

Answered by keuby
keuby asked this question in Q&A
Discussion options

You must be logged in to vote

将所有 css 文件捆到一个 css 文件中,可以使用 build.cssCodeSplit 选项,设置为 false 时,可以只创建一个 css 文件。

https://vitejs.dev/config/#build-csscodesplit

If disabled, all CSS in the entire project will be extracted into a single CSS file.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@keuby
Comment options

Comment options

You must be logged in to vote
1 reply
@yanglee2421
Comment options

Answer selected by keuby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants