vuejs / vue-style-loader

💅 vue style loader module for webpack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

css-loader 4.x.x support?

Sombian opened this issue · comments

vue-loader stopped working after upgrade css-loader to 4.x.x from 3.6.0.
i see some breaking changes documented on css-loader repo.
please fix this.

I have encountered the same problem as you do.
i can't find out what's wrong with webpack.config.js of my project
until open this issue.
plz fix this. or change official document of vue-loader.
thanks a lot.

@huangkaiqiao for most purposes you can safely swap out vue-style-loader with style-loader and your project should work fine. Also see #42

I will look into what exactly is causing the problem...

Edit: the problem is that css-loader's esModule option is set to true by default in v4. The correct workaround for now is replacing the css-loader declaration in your webpack config with:

{
    loader: 'css-loader',
    options: {
        esModule: false
    }
}

@foxxyz works for me. Thanks a lot.

Confirmed, @foxxyz solution worked

Minimal reproduction repo for reference: https://github.com/privatenumber/vue-css-loader-bug

I was stuck on this issue for days. @foxxyz solution worked for me.

耗费了好久时间来排查这个问题。希望更新文档

commented

Thanks. It's ok to use style-loader@2 to replace vue-style-loader.