Adjust package.json scripts and move all dev deps to the root package.json

This commit is contained in:
Alex Dima 2021-11-05 16:53:05 +01:00
parent ebcdd4fe0d
commit 7c6062ccf7
No known key found for this signature in database
GPG key ID: 39563C1504FDD0C9
45 changed files with 1252 additions and 5160 deletions

View file

@ -4,10 +4,10 @@ const fs = require('fs');
const Terser = require('terser');
const helpers = require('monaco-plugin-helpers');
const REPO_ROOT = path.resolve(__dirname, '..');
const REPO_ROOT = path.resolve(__dirname, '..', '..');
const sha1 = helpers.getGitVersion(REPO_ROOT);
const semver = require('../package.json').version;
const semver = require('../../package.json').version;
const headerVersion = semver + '(' + sha1 + ')';
const BUNDLED_FILE_HEADER = [
@ -32,9 +32,9 @@ function bundleOne(moduleId, exclude) {
out: 'release/dev/' + moduleId + '.js',
exclude: exclude,
paths: {
'vs/language/css': REPO_ROOT + '/out/amd',
'vs/language/css': REPO_ROOT + '/monaco-css/out/amd',
'vs/language/css/fillers/monaco-editor-core':
REPO_ROOT + '/out/amd/fillers/monaco-editor-core-amd'
REPO_ROOT + '/monaco-css/out/amd/fillers/monaco-editor-core-amd'
},
optimize: 'none',
packages: [
@ -60,14 +60,14 @@ function bundleOne(moduleId, exclude) {
},
{
name: 'vscode-nls',
location: path.join(REPO_ROOT, '/out/amd/fillers'),
location: path.join(REPO_ROOT, 'monaco-css/out/amd/fillers'),
main: 'vscode-nls'
}
]
},
async function (buildResponse) {
const devFilePath = path.join(REPO_ROOT, 'release/dev/' + moduleId + '.js');
const minFilePath = path.join(REPO_ROOT, 'release/min/' + moduleId + '.js');
const devFilePath = path.join(REPO_ROOT, 'monaco-css/release/dev/' + moduleId + '.js');
const minFilePath = path.join(REPO_ROOT, 'monaco-css/release/min/' + moduleId + '.js');
const fileContents = fs.readFileSync(devFilePath).toString();
console.log();
console.log(`Minifying ${devFilePath}...`);
@ -78,7 +78,7 @@ function bundleOne(moduleId, exclude) {
});
console.log(`Done minifying ${devFilePath}.`);
try {
fs.mkdirSync(path.join(REPO_ROOT, 'release/min'));
fs.mkdirSync(path.join(REPO_ROOT, 'monaco-css/release/min'));
} catch (err) {}
fs.writeFileSync(minFilePath, BUNDLED_FILE_HEADER + result.code);
}