Skip to content

Commit 8b584bd

Browse files
authored
fix: also support passed ES modules from css-loader in addition to CommonJS format (#47)
1 parent 477c25e commit 8b584bd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ module.exports.pitch = function (remainingRequest) {
3636
'',
3737
'// load the styles',
3838
'var content = require(' + request + ');',
39+
// get default export if list is an ES Module (CSS Loader v4+)
40+
"if(content.__esModule) content = content.default;",
3941
// content list format is [id, css, media, sourceMap]
4042
"if(typeof content === 'string') content = [[module.id, content, '']];",
4143
'if(content.locals) module.exports = content.locals;'

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy