mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
fix: throw if global css file is not found in webpack context (#5186)
This commit is contained in:
@ -88,7 +88,12 @@ export function getCssFileName(): string {
|
||||
}
|
||||
|
||||
export function loadAppCss(): void {
|
||||
events.notify(<LoadAppCSSEventData>{ eventName: "loadAppCss", object: app, cssFile: getCssFileName() });
|
||||
try {
|
||||
events.notify(<LoadAppCSSEventData>{ eventName: "loadAppCss", object: app, cssFile: getCssFileName() });
|
||||
} catch (e) {
|
||||
throw new Error(`The file ${getCssFileName()} couldn't be loaded! ` +
|
||||
`You may need to register it inside ./app/vendor.ts.`);
|
||||
}
|
||||
}
|
||||
|
||||
export function addCss(cssText: string): void {
|
||||
@ -97,4 +102,4 @@ export function addCss(cssText: string): void {
|
||||
|
||||
global.__onUncaughtError = function (error: NativeScriptError) {
|
||||
events.notify(<UnhandledErrorEventData>{ eventName: uncaughtErrorEvent, object: app, android: error, ios: error, error: error });
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user