mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
Fix extension private prop mangling when compiling all projects (#167464)
#167269
This commit is contained in:
@@ -7,17 +7,26 @@
|
||||
const webpack = require('webpack');
|
||||
const { Mangler } = require('../build/lib/mangleTypeScript');
|
||||
|
||||
let map;
|
||||
/**
|
||||
* Map of project paths to mangled file contents
|
||||
*
|
||||
* @type {Map<string, Map<string, string>>}
|
||||
*/
|
||||
const mangleMap = new Map();
|
||||
|
||||
/**
|
||||
* @param {string} projectPath
|
||||
*/
|
||||
function getMangledFileContents(projectPath) {
|
||||
if (!map) {
|
||||
let entry = mangleMap.get(projectPath);
|
||||
if (!entry) {
|
||||
console.log(`Mangling ${projectPath}`);
|
||||
const ts2tsMangler = new Mangler(projectPath, console.log);
|
||||
map = ts2tsMangler.computeNewFileContents();
|
||||
entry = ts2tsMangler.computeNewFileContents();
|
||||
mangleMap.set(projectPath, entry);
|
||||
}
|
||||
|
||||
return map;
|
||||
return entry;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user