diff --git a/build/gulpfile.common.js b/build/gulpfile.common.js index 23b1480a418..47f24f687ef 100644 --- a/build/gulpfile.common.js +++ b/build/gulpfile.common.js @@ -40,10 +40,10 @@ exports.loaderConfig = function (emptyPaths) { paths: { 'vs/extensions': 'extensions' } - } + }, + nodeModules: emptyPaths||[] }; - (emptyPaths || []).forEach(function(m) { result.paths[m] = 'empty:'; }); return result; }; diff --git a/src/vs/css.js b/src/vs/css.js index 710116c0651..eaa5d6d8e47 100644 --- a/src/vs/css.js +++ b/src/vs/css.js @@ -13,8 +13,6 @@ *--------------------------------------------------------------------------------------------- *--------------------------------------------------------------------------------------------- *--------------------------------------------------------------------------------------------*/ -/// -/// 'use strict'; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -100,7 +98,7 @@ var CSSLoaderPlugin; this._insertLinkNode(linkNode); }; return BrowserCSSLoader; - })(); + }()); /** * Prior to IE10, IE could not go above 31 stylesheets in a page * http://blogs.msdn.com/b/ieinternals/archive/2011/05/14/internet-explorer-stylesheet-rule-selector-import-sheet-limit-maximum.aspx @@ -201,7 +199,7 @@ var CSSLoaderPlugin; } }; return IE9CSSLoader; - })(BrowserCSSLoader); + }(BrowserCSSLoader)); var IE8CSSLoader = (function (_super) { __extends(IE8CSSLoader, _super); function IE8CSSLoader() { @@ -214,7 +212,7 @@ var CSSLoaderPlugin; }; }; return IE8CSSLoader; - })(IE9CSSLoader); + }(IE9CSSLoader)); var NodeCSSLoader = (function () { function NodeCSSLoader() { this.fs = require.nodeRequire('fs'); @@ -229,7 +227,7 @@ var CSSLoaderPlugin; }; NodeCSSLoader.BOM_CHAR_CODE = 65279; return NodeCSSLoader; - })(); + }()); // ------------------------------ Finally, the plugin var CSSPlugin = (function () { function CSSPlugin(cssLoader) { @@ -279,7 +277,7 @@ var CSSLoaderPlugin; }; CSSPlugin.BUILD_MAP = {}; return CSSPlugin; - })(); + }()); CSSLoaderPlugin.CSSPlugin = CSSPlugin; var Utilities = (function () { function Utilities() { @@ -411,7 +409,7 @@ var CSSLoaderPlugin; }); }; return Utilities; - })(); + }()); CSSLoaderPlugin.Utilities = Utilities; (function () { var cssLoader = null; diff --git a/src/vs/loader.js b/src/vs/loader.js index b7d5f30c3a1..49317011d21 100644 --- a/src/vs/loader.js +++ b/src/vs/loader.js @@ -13,7 +13,6 @@ *--------------------------------------------------------------------------------------------- *--------------------------------------------------------------------------------------------- *--------------------------------------------------------------------------------------------*/ -/// 'use strict'; // Limitation: To load jquery through the loader, always require 'jquery' and add a path for it in the loader configuration var _amdLoaderGlobal = this, define; @@ -123,7 +122,7 @@ var AMDLoader; }; Utilities.NEXT_ANONYMOUS_ID = 1; return Utilities; - })(); + }()); AMDLoader.Utilities = Utilities; var ConfigurationOptionsUtil = (function () { function ConfigurationOptionsUtil() { @@ -189,6 +188,9 @@ var AMDLoader; options.baseUrl += '/'; } } + if (!Array.isArray(options.nodeModules)) { + options.nodeModules = []; + } return options; }; ConfigurationOptionsUtil.mergeConfigurationOptions = function (overwrite, base) { @@ -232,7 +234,7 @@ var AMDLoader; return ConfigurationOptionsUtil.validateConfigurationOptions(result); }; return ConfigurationOptionsUtil; - })(); + }()); AMDLoader.ConfigurationOptionsUtil = ConfigurationOptionsUtil; var Configuration = (function () { function Configuration(options) { @@ -428,6 +430,10 @@ var AMDLoader; * Transform a module id to a location. Appends .js to module ids */ Configuration.prototype.moduleIdToPaths = function (moduleId) { + if (this.isBuild() && this.options.nodeModules.indexOf(moduleId) >= 0) { + // This is a node module and we are at build time, drop it + return ['empty:']; + } var result = moduleId; if (this.overwriteModuleIdToPath.hasOwnProperty(result)) { result = this.overwriteModuleIdToPath[result]; @@ -522,7 +528,7 @@ var AMDLoader; this.options.onError(err); }; return Configuration; - })(); + }()); AMDLoader.Configuration = Configuration; // ------------------------------------------------------------------------ // ModuleIdResolver @@ -602,7 +608,7 @@ var AMDLoader; this._config.onError(err); }; return ModuleIdResolver; - })(); + }()); AMDLoader.ModuleIdResolver = ModuleIdResolver; // ------------------------------------------------------------------------ // Module @@ -832,7 +838,7 @@ var AMDLoader; return this._unresolvedDependenciesCount === 0; }; return Module; - })(); + }()); AMDLoader.Module = Module; // ------------------------------------------------------------------------ // LoaderEvent @@ -859,7 +865,7 @@ var AMDLoader; this.timestamp = timestamp; } return LoaderEvent; - })(); + }()); AMDLoader.LoaderEvent = LoaderEvent; var LoaderEventRecorder = (function () { function LoaderEventRecorder(loaderAvailableTimestamp) { @@ -872,7 +878,7 @@ var AMDLoader; return this._events; }; return LoaderEventRecorder; - })(); + }()); AMDLoader.LoaderEventRecorder = LoaderEventRecorder; var NullLoaderEventRecorder = (function () { function NullLoaderEventRecorder() { @@ -885,7 +891,7 @@ var AMDLoader; }; NullLoaderEventRecorder.INSTANCE = new NullLoaderEventRecorder(); return NullLoaderEventRecorder; - })(); + }()); AMDLoader.NullLoaderEventRecorder = NullLoaderEventRecorder; var ModuleManager = (function () { function ModuleManager(scriptLoader) { @@ -1520,7 +1526,7 @@ var AMDLoader; } }; return ModuleManager; - })(); + }()); AMDLoader.ModuleManager = ModuleManager; /** * Load `scriptSrc` only once (avoid multiple