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 725330a7cd.
This commit is contained in:
Matt Bierner 2022-11-28 22:42:07 -08:00 committed by GitHub
parent 3e7637064d
commit 8b9891739b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 22 deletions

View file

@ -7,26 +7,17 @@
const webpack = require('webpack');
const { Mangler } = require('../build/lib/mangleTypeScript');
/**
* Map of project paths to mangled file contents
*
* @type {Map<string, Map<string, string>>}
*/
const mangleMap = new Map();
let map;
/**
* @param {string} projectPath
*/
function getMangledFileContents(projectPath) {
let entry = mangleMap.get(projectPath);
if (!entry) {
console.log(`Mangling ${projectPath}`);
if (!map) {
const ts2tsMangler = new Mangler(projectPath, console.log);
entry = ts2tsMangler.computeNewFileContents();
mangleMap.set(projectPath, entry);
map = ts2tsMangler.computeNewFileContents();
}
return entry;
return map;
}
/**

View file

@ -15,13 +15,6 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
const { NLSBundlePlugin } = require('vscode-nls-dev/lib/webpack-bundler');
const { DefinePlugin, optimize } = require('webpack');
const tsLoaderOptions = {
compilerOptions: {
'sourceMap': true,
},
onlyCompileBundledFiles: true,
};
function withNodeDefaults(/**@type WebpackConfig*/extConfig) {
/** @type WebpackConfig */
const defaultConfig = {
@ -49,7 +42,11 @@ function withNodeDefaults(/**@type WebpackConfig*/extConfig) {
// configure TypeScript loader:
// * enable sources maps for end-to-end source maps
loader: 'ts-loader',
options: tsLoaderOptions
options: {
compilerOptions: {
'sourceMap': true,
}
}
}, {
loader: path.resolve(__dirname, 'mangle-loader.js'),
options: {
@ -128,8 +125,11 @@ function withBrowserDefaults(/**@type WebpackConfig*/extConfig, /** @type Additi
// * enable sources maps for end-to-end source maps
loader: 'ts-loader',
options: {
...tsLoaderOptions,
compilerOptions: {
'sourceMap': true,
},
...(additionalOptions ? {} : { configFile: additionalOptions.configFile }),
onlyCompileBundledFiles: true,
}
},
{