fix bundle-config-loader order

# Conflicts:
#	packages/core/globals/index.ts
This commit is contained in:
Martin Guillon
2020-09-09 23:09:30 +02:00
parent 8bc5abe01b
commit 02d4f4bc2f
7 changed files with 8 additions and 20 deletions

View File

@ -1,8 +1,5 @@
// Require globals first so that snapshot takes __extends function.
const nsGlobals = require('../globals');
if (!global.NativeScriptHasInitGlobal) {
nsGlobals.initGlobal();
}
import '../globals';
// Types
import { AndroidApplication, iOSApplication } from '.';

View File

@ -1,5 +1,5 @@
const g = require('./globals');
g.initGlobal();
// using import is important to ensure webpack keep it in order
import './globals';
// Register "dynamically" loaded module that need to be resolved by the
// XML/component builders.

View File

@ -360,4 +360,4 @@ export function initGlobal() {
}
if (!global.NativeScriptHasInitGlobal) {
initGlobal();
}
}

View File

@ -1,7 +1,6 @@
/// <reference path="./global-types.d.ts" />
// Init globals first (use require to ensure it's always at the top)
const nsGlobals = require('./globals');
nsGlobals.initGlobal();
import '../globals';
export { iOSApplication, AndroidApplication } from './application';
export type { ApplicationEventData, LaunchEventData, OrientationChangedEventData, UnhandledErrorEventData, DiscardedErrorEventData, CssChangedEventData, LoadAppCSSEventData, AndroidActivityEventData, AndroidActivityBundleEventData, AndroidActivityRequestPermissionsEventData, AndroidActivityResultEventData, AndroidActivityNewIntentEventData, AndroidActivityBackPressedEventData, SystemAppearanceChangedEventData } from './application';

View File

@ -1,8 +1,5 @@
console.log('Loading inspector modules...');
import { initGlobal } from './globals';
if (!global.NativeScriptHasInitGlobal) {
initGlobal();
}
import './globals';
require('./debugger/webinspector-network');
require('./debugger/webinspector-dom');
require('./debugger/webinspector-css');

View File

@ -1,12 +1,7 @@
import '../../globals';
import { setActivityCallbacks, AndroidActivityCallbacks } from '.';
// use requires to ensure import order
const globals = require('../../globals');
const appModule = require('../../application');
if (global.__snapshot) {
globals.initGlobal();
}
/**
* NOTE: We cannot use NativeClass here because this is used in appComponents in webpack.config
* Whereby it bypasses the decorator transformation, hence pure es5 style written here

View File

@ -52,7 +52,7 @@ const loader: loader.Loader = function (source, map) {
}
source = `
require("${sourceModule}/bundle-entry-points");
import "${sourceModule}/bundle-entry-points";
${source}
`;