diff --git a/index.js b/index.js index 4adcd219..926a498b 100644 --- a/index.js +++ b/index.js @@ -36,6 +36,8 @@ module.exports.pitch = function (remainingRequest) { '', '// load the styles', 'var content = require(' + request + ');', + // get default export if list is an ES Module (CSS Loader v4+) + "if(content.__esModule) content = content.default;", // content list format is [id, css, media, sourceMap] "if(typeof content === 'string') content = [[module.id, content, '']];", 'if(content.locals) module.exports = content.locals;'