Strip webEndpointUrlTemplate from reh-web builds

This commit is contained in:
Alex Dima
2022-02-03 19:27:53 +01:00
parent 9fb5c8e094
commit 1b429e7432
2 changed files with 18 additions and 5 deletions

View File

@@ -346,6 +346,15 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
};
}
/**
* @param {object} product The parsed product.json file contents
*/
function tweakProductForServerWeb(product) {
const result = { ...product };
delete result.webEndpointUrlTemplate;
return result;
}
['reh', 'reh-web'].forEach(type => {
const optimizeTask = task.define(`optimize-vscode-${type}`, task.series(
util.rimraf(`out-vscode-${type}`),
@@ -358,7 +367,7 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
out: `out-vscode-${type}`,
inlineAmdImages: true,
bundleInfo: undefined,
fileContentMapper: createVSCodeWebFileContentMapper('.build/extensions')
fileContentMapper: createVSCodeWebFileContentMapper('.build/extensions', type === 'reh-web' ? tweakProductForServerWeb(product) : product)
})
));

View File

@@ -77,7 +77,10 @@ exports.vscodeWebEntryPoints = vscodeWebEntryPoints;
const buildDate = new Date().toISOString();
const createVSCodeWebProductConfigurationPatcher = () => {
/**
* @param {object} product The parsed product.json file contents
*/
const createVSCodeWebProductConfigurationPatcher = (product) => {
/**
* @param content {string} The contens of the file
* @param path {string} The absolute file path, always using `/`, even on Windows
@@ -139,10 +142,11 @@ const combineContentPatchers = (...patchers) => {
/**
* @param extensionsRoot {string} The location where extension will be read from
* @param {object} product The parsed product.json file contents
*/
const createVSCodeWebFileContentMapper = (extensionsRoot) => {
const createVSCodeWebFileContentMapper = (extensionsRoot, product) => {
return combineContentPatchers(
createVSCodeWebProductConfigurationPatcher(),
createVSCodeWebProductConfigurationPatcher(product),
createVSCodeWebBuiltinExtensionsPatcher(extensionsRoot)
);
};
@@ -160,7 +164,7 @@ const optimizeVSCodeWebTask = task.define('optimize-vscode-web', task.series(
out: 'out-vscode-web',
inlineAmdImages: true,
bundleInfo: undefined,
fileContentMapper: createVSCodeWebFileContentMapper('.build/web/extensions')
fileContentMapper: createVSCodeWebFileContentMapper('.build/web/extensions', product)
})
));