Skip to content

Commit 8b98917

Browse files
authored
Revert "Fix extension private prop mangling when compiling all projec… (#167490)
Revert "Fix extension private prop mangling when compiling all projects (#167464)" This reverts commit 725330a.
1 parent 3e76370 commit 8b98917

File tree

2 files changed

+13
-22
lines changed

2 files changed

+13
-22
lines changed

extensions/mangle-loader.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,17 @@
77
const webpack = require('webpack');
88
const { Mangler } = require('../build/lib/mangleTypeScript');
99

10-
/**
11-
* Map of project paths to mangled file contents
12-
*
13-
* @type {Map<string, Map<string, string>>}
14-
*/
15-
const mangleMap = new Map();
16-
10+
let map;
1711
/**
1812
* @param {string} projectPath
1913
*/
2014
function getMangledFileContents(projectPath) {
21-
let entry = mangleMap.get(projectPath);
22-
if (!entry) {
23-
console.log(`Mangling ${projectPath}`);
15+
if (!map) {
2416
const ts2tsMangler = new Mangler(projectPath, console.log);
25-
entry = ts2tsMangler.computeNewFileContents();
26-
mangleMap.set(projectPath, entry);
17+
map = ts2tsMangler.computeNewFileContents();
2718
}
2819

29-
return entry;
20+
return map;
3021
}
3122

3223
/**

extensions/shared.webpack.config.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
1515
const { NLSBundlePlugin } = require('vscode-nls-dev/lib/webpack-bundler');
1616
const { DefinePlugin, optimize } = require('webpack');
1717

18-
const tsLoaderOptions = {
19-
compilerOptions: {
20-
'sourceMap': true,
21-
},
22-
onlyCompileBundledFiles: true,
23-
};
24-
2518
function withNodeDefaults(/**@type WebpackConfig*/extConfig) {
2619
/** @type WebpackConfig */
2720
const defaultConfig = {
@@ -49,7 +42,11 @@ function withNodeDefaults(/**@type WebpackConfig*/extConfig) {
4942
// configure TypeScript loader:
5043
// * enable sources maps for end-to-end source maps
5144
loader: 'ts-loader',
52-
options: tsLoaderOptions
45+
options: {
46+
compilerOptions: {
47+
'sourceMap': true,
48+
}
49+
}
5350
}, {
5451
loader: path.resolve(__dirname, 'mangle-loader.js'),
5552
options: {
@@ -128,8 +125,11 @@ function withBrowserDefaults(/**@type WebpackConfig*/extConfig, /** @type Additi
128125
// * enable sources maps for end-to-end source maps
129126
loader: 'ts-loader',
130127
options: {
131-
...tsLoaderOptions,
128+
compilerOptions: {
129+
'sourceMap': true,
130+
},
132131
...(additionalOptions ? {} : { configFile: additionalOptions.configFile }),
132+
onlyCompileBundledFiles: true,
133133
}
134134
},
135135
{

0 commit comments

Comments
 (0)