-
Notifications
You must be signed in to change notification settings - Fork 916
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
Vue components css always come before other imported css #138
Comments
This is a limitation of the extract text plugin. To change it I will probably have to dig into the plugin's code a bit, but for now it seems the only solution is directly using a separate CSS file in the HTML. |
Just did a test and it seems the CSS is extracted in the module import order. Are you requiring the CSS before importing your components? |
Yes, this is my current main.js file:
I will try with again with a fresh vue-cli template tommorow, thank you for your time. |
Okay, i actualy tested it with a fresh vue-cli:webpack project and the problem remains:
after compiling with
where So far I am not able to place css files before vue components css, am I doing something wrong or is this a limitiation with the extract text plugin? https://gitlab.com/prog4mr/vue_loader.138 Thank you |
Okay, here's the reason: you are using To fix this simply use |
Perfect, thank you, no way i would figure that soon. |
Thanks @yyx990803 again, I solve my problem.
Here is my solution, I paste here for anyone who may need: // App.vue
import 'bootstrap/dist/css/bootstrap.min.css'
import 'font-awesome/css/font-awesome.min.css'
import '@/assets/css/main.css' Style for a single component, just write them between |
@yyx990803 when build ,Css import in main.js after Css in *.vue how to deel with this? |
@Zalezale i got the same issue after upgrading from vue-loader 14.2.2 to 15.2.1. I also import css files in the main vue component which will be imported after the styles from child components. But i got no solution |
why this way it doesn't work?
solutions
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src |
Using vue-cli webpack project, if i add the extract text plugin to
webpack.base.conf.js
like so:then on my main.js:line 1 i add this:
and then
npm run build
The generated css file has the concated css definitions in this order:
What I'm looking for is to have myfile.css definitions at the beggining of the generated css file (useful for loading bootstrap theme first for example), but so far no chance. Am i missing something or is this a limitiation or issue with vue-loader? Thank you.
The text was updated successfully, but these errors were encountered: