mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
Do not use lazy requires where not needed.
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import * as trace from "trace";
|
||||
import {debug, ScopeError, SourceError, Source} from "utils/debug";
|
||||
import {debug, ScopeError, SourceError, Source} from "utils/debug";
|
||||
import * as xml from "xml";
|
||||
import {View, Template} from "ui/core/view";
|
||||
import {File, path, knownFolders} from "file-system";
|
||||
@ -13,6 +12,13 @@ import * as traceModule from "trace";
|
||||
|
||||
const defaultNameSpaceMatcher = /tns\.xsd$/i;
|
||||
|
||||
var trace: typeof traceModule;
|
||||
function ensureTrace() {
|
||||
if (!trace) {
|
||||
trace = require("trace");
|
||||
}
|
||||
}
|
||||
|
||||
export function parse(value: string | Template, context: any): View {
|
||||
if (isString(value)) {
|
||||
var viewToReturn: View;
|
||||
@ -90,7 +96,7 @@ function loadCustomComponent(componentPath: string, componentName?: string, attr
|
||||
if (parentPage) {
|
||||
parentPage.addCssFile(cssFilePath);
|
||||
} else {
|
||||
var trace: typeof traceModule = require("trace");
|
||||
ensureTrace();
|
||||
|
||||
trace.write("CSS file found but no page specified. Please specify page in the options!", trace.categories.Error, trace.messageType.error);
|
||||
}
|
||||
|
Reference in New Issue
Block a user