fix(style_url_resolver): include `asset:` urls into precompiled stylesheets.

Closes #4926
This commit is contained in:
Tobias Bosch 2015-10-26 16:34:40 -07:00
parent 60bedb43de
commit d8b3601927
2 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ export class StyleWithImports {
export function isStyleUrlResolvable(url: string): boolean { export function isStyleUrlResolvable(url: string): boolean {
if (isBlank(url) || url.length === 0 || url[0] == '/') return false; if (isBlank(url) || url.length === 0 || url[0] == '/') return false;
var schemeMatch = RegExpWrapper.firstMatch(_urlWithSchemaRe, url); var schemeMatch = RegExpWrapper.firstMatch(_urlWithSchemaRe, url);
return isBlank(schemeMatch) || schemeMatch[1] == 'package'; return isBlank(schemeMatch) || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset';
} }
/** /**

View File

@ -87,7 +87,7 @@ export function main() {
() => { expect(isStyleUrlResolvable('package:someUrl.css')).toBe(true); }); () => { expect(isStyleUrlResolvable('package:someUrl.css')).toBe(true); });
it('should resolve asset: urls', it('should resolve asset: urls',
() => { expect(isStyleUrlResolvable('package:someUrl.css')).toBe(true); }); () => { expect(isStyleUrlResolvable('asset:someUrl.css')).toBe(true); });
it('should not resolve empty urls', () => { it('should not resolve empty urls', () => {
expect(isStyleUrlResolvable(null)).toBe(false); expect(isStyleUrlResolvable(null)).toBe(false);