Skip to content

Commit

Permalink
👽 Fix style won't load due to vue-style-loader & css-loader v4 co…
Browse files Browse the repository at this point in the history
…mpatibility

See vuejs/vue-style-loader#46
  • Loading branch information
gluons committed Aug 15, 2020
1 parent b5736ba commit 6814d51
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/getCSSUses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@ import { RuleSetUseItem } from 'webpack';
* @param {number} [importLoaders=1] `css-loader`'s `importLoaders`
*/
export default function getCSSUses(importLoaders = 1): RuleSetUseItem[] {
/*
* To make `vue-style-loader` works with `css-loader` v4,
* we need to disable `esModule`.
*
* See https://github.com/vuejs/vue-style-loader/issues/46
*/

const cssUses: RuleSetUseItem[] = [
'vue-style-loader',
{
loader: 'css-loader',
options: {
importLoaders,
esModule: false,
sourceMap: true
}
},
Expand Down

0 comments on commit 6814d51

Please sign in to comment.