Don´t get it: Want to load component styles last


Sorry if this is something easy, but i don´t get it. When i build my app the component styles (SFC) are loaded first and they get overwritten by my element-ui styles. I understand, that webpack ist looking for the order of the imports. But even if i put element-ui first it doesn´t work:

import 'element-ui/lib/theme-chalk/index.css';    
import ElementUI from 'element-ui';
import Vue from 'vue'
Vue.use(ElementUI, { locale })
import App from './App'
import router from './router'


Not sure if css-loader is the way and even wehen what to put in here.

const webpack = require('webpack');
    module.exports = {
      css: {
        loaderOptions: {
          css: {
            // options here will be passed to css-loader. Is this the way?

Please help. I´ve looked for hours and don´t get it.



Your code doesn’t show where you actually import element’s css?


Oh sorry. It´s on the top. I have edited the post.


Hm, don’t see why those styles should not be injected first.

Are you importing them only there?

Do you have any webpack config changed?


Thanks for looking into it. Yes, there is no import in any other file. This is my default vue.config:

const webpack = require('webpack');
module.exports = {
  configureWebpack: {
    plugins: [
      new webpack.ProvidePlugin({
        $: 'jquery',
        jQuery: 'jquery',
        'window.jQuery': 'jquery'