Adopt esbuild in monaco-html

This commit is contained in:
Alexandru Dima 2021-11-12 11:10:04 +01:00
parent 9a52545094
commit c8344afb94
No known key found for this signature in database
GPG key ID: 39563C1504FDD0C9
9 changed files with 119 additions and 151 deletions

View file

@ -6,6 +6,7 @@
const fs = require('fs');
const path = require('path');
const cp = require('child_process');
const esbuild = require('esbuild');
const REPO_ROOT = path.join(__dirname, '..');
@ -154,6 +155,21 @@ function dts(_source, _destination, namespace) {
}
exports.dts = dts;
/**
* @param {import('esbuild').BuildOptions} options
*/
function build(options) {
esbuild.build(options).then((result) => {
if (result.errors.length > 0) {
console.error(result.errors);
}
if (result.warnings.length > 0) {
console.error(result.warnings);
}
});
}
exports.build = build;
function getGitVersion() {
const git = path.join(REPO_ROOT, '.git');
const headPath = path.join(git, 'HEAD');