mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 22:01:42 +08:00
feat: global autoRegisterUIModules to disable auto ui registering
That way you can do it manually which means not everything will be packaged with webpack!
This commit is contained in:
@ -4,7 +4,10 @@ import './globals';
|
||||
// Register "dynamically" loaded module that need to be resolved by the
|
||||
// XML/component builders.
|
||||
import * as coreUIModules from './ui/index';
|
||||
global.registerModule('@nativescript/core/ui', () => coreUIModules);
|
||||
if (global.autoRegisterUIModules !== false) {
|
||||
global.registerModule('@nativescript/core/ui', () => coreUIModules);
|
||||
}
|
||||
|
||||
|
||||
// global.registerModule('text/formatted-string', () => require('./text/formatted-string'));
|
||||
// global.registerModule('text/span', () => require('./text/span'));
|
||||
|
13
packages/core/global-types.d.ts
vendored
13
packages/core/global-types.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
declare var global: NodeJS.Global & typeof globalThis;
|
||||
declare let global: NodeJS.Global & typeof globalThis;
|
||||
|
||||
interface ModuleResolver {
|
||||
/**
|
||||
@ -124,6 +124,7 @@ declare namespace NodeJS {
|
||||
TNS_WEBPACK?: boolean;
|
||||
isIOS?: boolean;
|
||||
isAndroid?: boolean;
|
||||
autoRegisterUIModules?: boolean;
|
||||
__requireOverride?: (name: string, dir: string) => any;
|
||||
}
|
||||
}
|
||||
@ -209,7 +210,7 @@ declare type HeaderInit = Headers | Array<string>;
|
||||
declare function fetch(url: string, init?: RequestInit): Promise<Response>;
|
||||
|
||||
// declare var console: Console;
|
||||
declare var require: NodeRequire;
|
||||
declare let require: NodeRequire;
|
||||
|
||||
// Extend NodeRequire with the webpack's require context extension.
|
||||
interface RequireContext {
|
||||
@ -223,12 +224,12 @@ interface NodeRequire {
|
||||
context(path: string, deep?: boolean, filter?: RegExp): RequireContext;
|
||||
}
|
||||
|
||||
declare var __dirname: string;
|
||||
declare var __filename: string;
|
||||
declare let __dirname: string;
|
||||
declare let __filename: string;
|
||||
|
||||
declare var module: NodeModule;
|
||||
declare let module: NodeModule;
|
||||
// Same as module.exports
|
||||
declare var exports: any;
|
||||
declare let exports: any;
|
||||
|
||||
// Global functions
|
||||
declare function Deprecated(target: Object, key?: string | symbol, value?: any): void;
|
||||
|
Reference in New Issue
Block a user