Adopt latest loader

This commit is contained in:
Alex Dima 2015-11-25 09:17:58 +01:00
parent 4ea2714df8
commit 1736f67195
4 changed files with 55 additions and 12 deletions

View file

@ -2,14 +2,24 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
* Please make sure to make edits in the .ts file at https://github.com/Microsoft/vscode-loader/
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*--------------------------------------------------------------------------------------------*/
/// <reference path="declares.ts" />
/// <reference path="loader.ts" />
'use strict';
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var _cssPluginGlobal = this;
var CSSLoaderPlugin;
@ -405,8 +415,8 @@ var CSSLoaderPlugin;
CSSLoaderPlugin.Utilities = Utilities;
(function () {
var cssLoader = null;
var isAtomShell = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions['electron'] !== 'undefined');
if (typeof process !== 'undefined' && process.versions && !!process.versions.node && !isAtomShell) {
var isElectron = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions['electron'] !== 'undefined');
if (typeof process !== 'undefined' && process.versions && !!process.versions.node && !isElectron) {
cssLoader = new NodeCSSLoader();
}
else if (typeof navigator !== 'undefined' && navigator.userAgent.indexOf('MSIE 9') >= 0) {

View file

@ -2,6 +2,17 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
* Please make sure to make edits in the .ts file at https://github.com/Microsoft/vscode-loader/
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*--------------------------------------------------------------------------------------------*/
/// <reference path="declares.ts" />
'use strict';
// Limitation: To load jquery through the loader, always require 'jquery' and add a path for it in the loader configuration
@ -1717,7 +1728,7 @@ var AMDLoader;
recorder.record(LoaderEventType.NodeBeginEvaluatingScript, scriptSrc);
var vmScriptSrc = _this._path.normalize(scriptSrc);
// Make the script src friendly towards electron
if (isAtomRenderer) {
if (isElectronRenderer) {
var driveLetterMatch = vmScriptSrc.match(/^([a-z])\:(.*)/);
if (driveLetterMatch) {
vmScriptSrc = driveLetterMatch[1].toUpperCase() + ':' + driveLetterMatch[2];
@ -1825,11 +1836,11 @@ var AMDLoader;
};
return RequireFunc;
})();
var global = _amdLoaderGlobal, hasPerformanceNow = (global.performance && typeof global.performance.now === 'function'), isWebWorker, isAtomRenderer, isAtomMain, isNode, scriptLoader, moduleManager, loaderAvailableTimestamp;
var global = _amdLoaderGlobal, hasPerformanceNow = (global.performance && typeof global.performance.now === 'function'), isWebWorker, isElectronRenderer, isElectronMain, isNode, scriptLoader, moduleManager, loaderAvailableTimestamp;
function initVars() {
isWebWorker = (typeof global.importScripts === 'function');
isAtomRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions['electron'] !== 'undefined' && process.type === 'renderer');
isAtomMain = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions['electron'] !== 'undefined' && process.type === 'browser');
isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions['electron'] !== 'undefined' && process.type === 'renderer');
isElectronMain = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions['electron'] !== 'undefined' && process.type === 'browser');
isNode = (typeof module !== 'undefined' && !!module.exports);
if (isWebWorker) {
scriptLoader = new OnlyOnceScriptLoader(new WorkerScriptLoader());
@ -1893,7 +1904,7 @@ var AMDLoader;
global.nodeRequire = nodeRequire;
RequireFunc.nodeRequire = nodeRequire;
}
if (isNode && !isAtomRenderer) {
if (isNode && !isElectronRenderer) {
module.exports = RequireFunc;
// These two defs are fore the local closure defined in node in the case that the loader is concatenated
define = function () {
@ -1906,7 +1917,7 @@ var AMDLoader;
if (typeof global.require !== 'undefined' && typeof global.require !== 'function') {
RequireFunc.config(global.require);
}
if (!isAtomRenderer) {
if (!isElectronRenderer) {
global.define = DefineFunc;
}
else {

View file

@ -2,6 +2,17 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
* Please make sure to make edits in the .ts file at https://github.com/Microsoft/vscode-loader/
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*--------------------------------------------------------------------------------------------*/
/// <reference path="declares.ts" />
/// <reference path="loader.ts" />
'use strict';

View file

@ -2,6 +2,17 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
* Please make sure to make edits in the .ts file at https://github.com/Microsoft/vscode-loader/
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*---------------------------------------------------------------------------------------------
*--------------------------------------------------------------------------------------------*/
/// <reference path="declares.ts" />
/// <reference path="loader.ts" />
'use strict';
@ -164,8 +175,8 @@ var TextLoaderPlugin;
TextLoaderPlugin.Utilities = Utilities;
(function () {
var textLoader = null;
var isAtomShell = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions['electron'] !== 'undefined');
if (typeof process !== 'undefined' && process.versions && !!process.versions.node && !isAtomShell) {
var isElectron = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions['electron'] !== 'undefined');
if (typeof process !== 'undefined' && process.versions && !!process.versions.node && !isElectron) {
textLoader = new NodeTextLoader();
}
else {