(url: string)
| 158 | } |
| 159 | |
| 160 | public static fromFile(url: string): CSSSource { |
| 161 | // .scss, .sass, etc. css files in vanilla app are usually compiled to .css so we will try to load a compiled file first. |
| 162 | const cssFileUrl = url.replace(/\..\w+$/, '.css'); |
| 163 | if (cssFileUrl !== url) { |
| 164 | const cssFile = CSSSource.resolveCSSPathFromURL(cssFileUrl); |
| 165 | if (cssFile) { |
| 166 | return new CSSSource(undefined, url, cssFile, undefined); |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | const file = CSSSource.resolveCSSPathFromURL(url); |
| 171 | |
| 172 | return new CSSSource(undefined, url, file, undefined); |
| 173 | } |
| 174 | |
| 175 | public static fromFileImport(url: string, importSource: string): CSSSource { |
| 176 | const file = CSSSource.resolveCSSPathFromURL(url, importSource); |
no test coverage detected