Closed bux closed 3 years ago
@underfin @yyx990803 Using vite 2.0.0-beta.49 the order of the built css file still puts all extracted SFC css before everything that's in index.css.
import { createApp } from "vue"
import App from "./App.vue"
import "./index.css"
One could argue that this is due to the index.css file being imported after App.vue. When moving the import of index.css to the top the order seems to be ok (for my case).
The templates and even tailwind suggest above import order.
Hence I would expect that when a css file is imported that all extracted SFC css is appended automatically despite the order of imports during a prodution build. Or it needs to be documented.
Or am I missing something?
@bux isn't it expected behavior for CSS to be extracted in the order they are imported?
I agree with you. The confusion arose because of the order of the imports suggested in the templates and the tailwind documentation. Especially the latter would be kind of "bad practice" then.
Describe the bug
I'm using vite with tailwind. Inside the index.css file I import the three tailwind base files.
The output of the
vite build
command though starts with all css from the SFCs (postcss-nested is used) then adds the imported tailwind files and finally adds media queries from tailwind.I would expect to have the SFC css after everything that's inside "index.css"
Reproduction
https://bitbucket.org/kh-JDA/crguide-vue3/src/master/
System Info
vite
version: "^1.0.0-rc.13"vue
version (fromyarn.lock
orpackage-lock.json
) 3.0.3@vue/compiler-sfc
version 3.0.3Logs (Optional if provided reproduction)