mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Reload app.css and clear file resolver cache on livesync.
This commit is contained in:
2
file-system/file-name-resolver.d.ts
vendored
2
file-system/file-name-resolver.d.ts
vendored
@@ -12,9 +12,11 @@ declare module "file-system/file-name-resolver" {
|
||||
export class FileNameResolver {
|
||||
constructor(context: PlatformContext);
|
||||
resolveFileName(path: string, ext: string): string;
|
||||
clearCache(): void;
|
||||
}
|
||||
|
||||
export function resolveFileName(path: string, ext: string): string;
|
||||
export function clearCache(): void;
|
||||
|
||||
//@private
|
||||
export function findFileMatch(path: string, ext: string, candidates: Array<string>, context: PlatformContext): string
|
||||
|
||||
@@ -126,6 +126,10 @@ export class FileNameResolver implements definition.FileNameResolver {
|
||||
return result;
|
||||
}
|
||||
|
||||
public clearCache(): void {
|
||||
this._cache = {};
|
||||
}
|
||||
|
||||
private resolveFileNameImpl(path: string, ext: string): string {
|
||||
var result: string = null;
|
||||
path = fs.path.normalize(path);
|
||||
@@ -239,3 +243,8 @@ export function resolveFileName(path: string, ext: string): string {
|
||||
return resolverInstance.resolveFileName(path, ext);
|
||||
}
|
||||
|
||||
export function clearCache(): void {
|
||||
if (resolverInstance) {
|
||||
resolverInstance.clearCache();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user