Use the global monaco only in the AMD case (see microsoft/monaco-editor#1974)

This commit is contained in:
Alex Dima 2020-09-07 16:48:41 +02:00
parent d089cc232d
commit 1a46d23399
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0
15 changed files with 370 additions and 250 deletions

View file

@ -21,7 +21,7 @@ const BUNDLED_FILE_HEADER = [
].join('\n');
bundleOne('monaco.contribution');
bundleOne('htmlMode');
bundleOne('htmlMode', ['vs/language/html/monaco.contribution']);
bundleOne('htmlWorker');
function bundleOne(moduleId, exclude) {
@ -32,7 +32,9 @@ function bundleOne(moduleId, exclude) {
out: 'release/dev/' + moduleId + '.js',
exclude: exclude,
paths: {
'vs/language/html': REPO_ROOT + '/out/amd'
'vs/language/html': REPO_ROOT + '/out/amd',
'vs/language/html/fillers/monaco-editor-core':
REPO_ROOT + '/out/amd/fillers/monaco-editor-core-amd'
},
optimize: 'none',
packages: [
@ -72,7 +74,7 @@ function bundleOne(moduleId, exclude) {
}
]
},
function (buildResponse) {
async function (buildResponse) {
const devFilePath = path.join(
REPO_ROOT,
'release/dev/' + moduleId + '.js'
@ -84,12 +86,12 @@ function bundleOne(moduleId, exclude) {
const fileContents = fs.readFileSync(devFilePath).toString();
console.log();
console.log(`Minifying ${devFilePath}...`);
const result = terser.minify(fileContents, {
const result = await terser.minify(fileContents, {
output: {
comments: 'some'
}
});
console.log(`Done.`);
console.log(`Done minifying ${devFilePath}.`);
try {
fs.mkdirSync(path.join(REPO_ROOT, 'release/min'));
} catch (err) {}