Skip to content

Commit

Permalink
better import CSS detection for browsers (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 authored Mar 5, 2021
1 parent f4d6ede commit b98aee1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/plugin-import-css/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ImportCssResource extends ResourceInterface {
}

async shouldIntercept(url, body, headers) {
const isCssInJs = path.extname(url) === this.extensions[0] && headers.request['sec-fetch-dest'] === 'empty';
const isCssInJs = path.extname(url) === this.extensions[0] && headers.request.accept.indexOf('text/css') < 0;

return Promise.resolve(isCssInJs);
}
Expand Down

0 comments on commit b98aee1

Please sign in to comment.