forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.ts
More file actions
60 lines (54 loc) · 1.55 KB
/
common.ts
File metadata and controls
60 lines (54 loc) · 1.55 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import * as glob from 'glob';
import * as path from 'path';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
import { ExtensionRootDir, isCI } from '../constants';
export const nodeModulesToExternalize = [
'unicode/category/Lu',
'unicode/category/Ll',
'unicode/category/Lt',
'unicode/category/Lo',
'unicode/category/Lm',
'unicode/category/Nl',
'unicode/category/Mn',
'unicode/category/Mc',
'unicode/category/Nd',
'unicode/category/Pc',
'@jupyterlab/services',
'azure-storage',
'request',
'request-progress',
'source-map-support',
'diff-match-patch',
'sudo-prompt',
'node-stream-zip',
'xml2js',
'vsls/vscode',
'pdfkit',
'crypto-js',
'fontkit',
'linebreak',
'png-js'
];
export const nodeModulesToReplacePaths = [
...nodeModulesToExternalize
];
export function getDefaultPlugins(name: 'extension' | 'debugger' | 'dependencies' | 'datascience-ui') {
const plugins = [];
if (!isCI) {
plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'static',
reportFilename: `${name}.analyzer.html`
})
);
}
return plugins;
}
export function getListOfExistingModulesInOutDir() {
const outDir = path.join(ExtensionRootDir, 'out', 'client');
const files = glob.sync('**/*.js', { sync: true, cwd: outDir });
return files.map(filePath => `./${filePath.slice(0, -3)}`);
}