mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 19:42:56 +01:00
Adopt new scripts in monaco-json
This commit is contained in:
parent
94ca41beeb
commit
bc3274a7c8
8 changed files with 108 additions and 136 deletions
43
monaco-json/scripts/build.js
Normal file
43
monaco-json/scripts/build.js
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
const esbuild = require('esbuild');
|
||||
const alias = require('esbuild-plugin-alias');
|
||||
const path = require('path');
|
||||
const cp = require('child_process');
|
||||
const { copyFile, removeDir, tsc, dts } = require('../../build/utils');
|
||||
|
||||
removeDir(`monaco-json/release`);
|
||||
removeDir(`monaco-json/out`);
|
||||
|
||||
tsc(`monaco-json/src/tsconfig.json`);
|
||||
|
||||
dts(`monaco-json/out/amd/monaco.contribution.d.ts`, `monaco-json/monaco.d.ts`, 'monaco.languages.json');
|
||||
|
||||
esbuild.build({
|
||||
entryPoints: ['src/jsonMode.ts', 'src/json.worker.ts', 'src/monaco.contribution.ts'],
|
||||
bundle: true,
|
||||
target: 'esnext',
|
||||
format: 'esm',
|
||||
external: ['monaco-editor-core', '*/jsonMode'],
|
||||
outdir: 'release/esm/',
|
||||
plugins: [
|
||||
alias({
|
||||
'vscode-nls': path.join(__dirname, '../src/fillers/vscode-nls.ts'),
|
||||
}),
|
||||
],
|
||||
}).then((result) => {
|
||||
if (result.errors.length > 0) {
|
||||
console.error(result.errors);
|
||||
}
|
||||
if (result.warnings.length > 0) {
|
||||
console.error(result.warnings);
|
||||
}
|
||||
});
|
||||
|
||||
copyFile('monaco-json/out/amd/monaco.contribution.d.ts', 'monaco-json/release/esm/monaco.contribution.d.ts');
|
||||
copyFile('monaco-json/out/amd/fillers/monaco-editor-core.d.ts', 'monaco-json/release/esm/fillers/monaco-editor-core.d.ts');
|
||||
|
||||
cp.spawnSync(process.execPath, [path.join(__dirname, './bundle.js')], { stdio: 'inherit', stderr: 'inherit' });
|
||||
Loading…
Add table
Add a link
Reference in a new issue