fix(style_url_resolver): include `asset:` urls into precompiled stylesheets.
Closes #4926
This commit is contained in:
parent
60bedb43de
commit
d8b3601927
|
@ -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';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue