mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
Update build scripts
This commit is contained in:
@@ -345,7 +345,7 @@ export function acquireWebNodePaths() {
|
||||
const root = path.join(__dirname, '..', '..');
|
||||
const webPackageJSON = path.join(root, '/remote/web', 'package.json');
|
||||
const webPackages = JSON.parse(fs.readFileSync(webPackageJSON, 'utf8')).dependencies;
|
||||
const nodePaths: { [key: string]: string } = {};
|
||||
const nodePaths: { [key: string]: string } = { };
|
||||
for (const key of Object.keys(webPackages)) {
|
||||
const packageJSON = path.join(root, 'node_modules', key, 'package.json');
|
||||
const packageData = JSON.parse(fs.readFileSync(packageJSON, 'utf8'));
|
||||
@@ -366,6 +366,23 @@ export function acquireWebNodePaths() {
|
||||
return nodePaths;
|
||||
}
|
||||
|
||||
export function createExternalLoaderConfig(webEndpoint?: string, commit?: string, quality?: string) {
|
||||
if (!webEndpoint || !commit || !quality) {
|
||||
return undefined;
|
||||
}
|
||||
webEndpoint = webEndpoint + `/${quality}/${commit}`;
|
||||
let nodePaths = acquireWebNodePaths();
|
||||
Object.keys(nodePaths).map(function (key, _) {
|
||||
nodePaths[key] = `${webEndpoint}/node_modules/${key}/${nodePaths[key]}`;
|
||||
});
|
||||
const externalLoaderConfig = {
|
||||
baseUrl: `${webEndpoint}/out`,
|
||||
recordStats: true,
|
||||
paths: nodePaths
|
||||
};
|
||||
return externalLoaderConfig;
|
||||
}
|
||||
|
||||
export function buildWebNodePaths(outDir: string) {
|
||||
const result = () => new Promise<void>((resolve, _) => {
|
||||
const root = path.join(__dirname, '..', '..');
|
||||
|
||||
Reference in New Issue
Block a user