markstory / mini-asset

A simple set of asset build tools that provides a config file and extensible integrations with pre-processors & minifiers.
MIT License
64 stars 17 forks source link

Imported CSS files with media queries not checked #23

Closed berarma closed 8 years ago

berarma commented 8 years ago

@import rules with media queries are ignored when checking for changes in CSS files. Examples of such rules:

@import url("fineprint.css") print;
@import url("bluish.css") projection, tv;
@import "common.css" screen, projection;
@import url('landscape.css') screen and (orientation:landscape);

I'm testing a fix using the following modified regular expression in CssUtils:

const IMPORT_PATTERN = '/^\s*@import\s*(?:(?:([\'"])([^\'"]+)\\1)|(?:url\(([\'"])([^\'"]+)\\3\)))(\s.*)?;/m';

I guess this should be enough.

markstory commented 8 years ago

Thanks! I'll get that fixed up.

markstory commented 8 years ago

Pull request up now.

berarma commented 8 years ago

Thanks!