mirror of
https://github.com/Microsoft/vscode
synced 2024-10-05 19:02:54 +00:00
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:
parent
3e7637064d
commit
8b9891739b
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue