forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap-amd.js
43 lines (34 loc) · 1.26 KB
/
bootstrap-amd.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
var path = require('path');
var loader = require('./vs/loader');
function uriFromPath(_path) {
var pathName = path.resolve(_path).replace(/\\/g, '/');
if (pathName.length > 0 && pathName.charAt(0) !== '/') {
pathName = '/' + pathName;
}
return encodeURI('file://' + pathName);
}
var rawNlsConfig = process.env['VSCODE_NLS_CONFIG'];
var nlsConfig = rawNlsConfig ? JSON.parse(rawNlsConfig) : { availableLanguages: {} };
loader.config({
baseUrl: uriFromPath(__dirname),
catchError: true,
nodeRequire: require,
nodeMain: __filename,
'vs/nls': nlsConfig,
nodeCachedDataDir: process.env['VSCODE_NODE_CACHED_DATA_DIR_' + process.pid]
});
if (nlsConfig.pseudo) {
loader(['vs/nls'], function (nlsPlugin) {
nlsPlugin.setPseudoTranslation(nlsConfig.pseudo);
});
}
exports.bootstrap = function (entrypoint) {
if (!entrypoint) {
return;
}
loader([entrypoint], function () { }, function (err) { console.error(err); });
};