mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 12:45:39 +01:00
Adjust package.json scripts and move all dev deps to the root package.json
This commit is contained in:
parent
ebcdd4fe0d
commit
7c6062ccf7
45 changed files with 1252 additions and 5160 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,15 +6,15 @@
|
|||
const path = require('path');
|
||||
const helpers = require('monaco-plugin-helpers');
|
||||
|
||||
const REPO_ROOT = path.join(__dirname, '../');
|
||||
const REPO_ROOT = path.join(__dirname, '../../');
|
||||
|
||||
helpers.packageESM({
|
||||
repoRoot: REPO_ROOT,
|
||||
esmSource: 'out/esm',
|
||||
esmDestination: 'release/esm',
|
||||
esmSource: 'monaco-css/out/esm',
|
||||
esmDestination: 'monaco-css/release/esm',
|
||||
entryPoints: ['monaco.contribution.js', 'cssMode.js', 'css.worker.js'],
|
||||
resolveAlias: {
|
||||
'vscode-nls': path.join(REPO_ROOT, 'out/esm/fillers/vscode-nls.js')
|
||||
'vscode-nls': path.join(REPO_ROOT, 'monaco-css/out/esm/fillers/vscode-nls.js')
|
||||
},
|
||||
resolveSkip: ['monaco-editor-core'],
|
||||
destinationFolderSimplification: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue