Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

fix: bundling with Angular CLI and Webpack #159

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/critters/src/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ function validateMediaType(node) {
* is HTML safe and does not cause any injection issue
*/
export function validateMediaQuery(query) {
const mediaTree = mediaParser(query);
// The below is needed for consumption with webpack.
const mediaParserFn = 'default' in mediaParser ? mediaParser.default : mediaParser;
const mediaTree = mediaParserFn(query);
const nodeTypes = new Set(['media-type', 'keyword', 'media-feature']);

const stack = [mediaTree];
Expand Down
Loading