mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 11:35:40 +01:00
parent
91edee5791
commit
69809452a8
2 changed files with 22 additions and 11 deletions
|
|
@ -47,7 +47,7 @@ buildESM({
|
||||||
'src/language/css/cssMode.ts',
|
'src/language/css/cssMode.ts',
|
||||||
'src/language/css/css.worker.ts'
|
'src/language/css/css.worker.ts'
|
||||||
],
|
],
|
||||||
external: ['monaco-editor-core', '*/cssMode']
|
external: ['monaco-editor-core', '*/cssMode', '*/monaco.contribution']
|
||||||
});
|
});
|
||||||
buildAMD({
|
buildAMD({
|
||||||
base: 'language/css',
|
base: 'language/css',
|
||||||
|
|
@ -58,7 +58,8 @@ buildAMD({
|
||||||
buildAMD({
|
buildAMD({
|
||||||
base: 'language/css',
|
base: 'language/css',
|
||||||
entryPoint: 'src/language/css/cssMode.ts',
|
entryPoint: 'src/language/css/cssMode.ts',
|
||||||
amdModuleId: 'vs/language/css/cssMode'
|
amdModuleId: 'vs/language/css/cssMode',
|
||||||
|
external: ['*/monaco.contribution']
|
||||||
});
|
});
|
||||||
buildAMD({
|
buildAMD({
|
||||||
base: 'language/css',
|
base: 'language/css',
|
||||||
|
|
@ -77,7 +78,7 @@ buildESM({
|
||||||
'src/language/html/htmlMode.ts',
|
'src/language/html/htmlMode.ts',
|
||||||
'src/language/html/html.worker.ts'
|
'src/language/html/html.worker.ts'
|
||||||
],
|
],
|
||||||
external: ['monaco-editor-core', '*/htmlMode']
|
external: ['monaco-editor-core', '*/htmlMode', '*/monaco.contribution']
|
||||||
});
|
});
|
||||||
buildAMD({
|
buildAMD({
|
||||||
base: 'language/html',
|
base: 'language/html',
|
||||||
|
|
@ -88,7 +89,8 @@ buildAMD({
|
||||||
buildAMD({
|
buildAMD({
|
||||||
base: 'language/html',
|
base: 'language/html',
|
||||||
entryPoint: 'src/language/html/htmlMode.ts',
|
entryPoint: 'src/language/html/htmlMode.ts',
|
||||||
amdModuleId: 'vs/language/html/htmlMode'
|
amdModuleId: 'vs/language/html/htmlMode',
|
||||||
|
external: ['*/monaco.contribution']
|
||||||
});
|
});
|
||||||
buildAMD({
|
buildAMD({
|
||||||
base: 'language/html',
|
base: 'language/html',
|
||||||
|
|
@ -107,7 +109,7 @@ buildESM({
|
||||||
'src/language/json/jsonMode.ts',
|
'src/language/json/jsonMode.ts',
|
||||||
'src/language/json/json.worker.ts'
|
'src/language/json/json.worker.ts'
|
||||||
],
|
],
|
||||||
external: ['monaco-editor-core', '*/jsonMode']
|
external: ['monaco-editor-core', '*/jsonMode', '*/monaco.contribution']
|
||||||
});
|
});
|
||||||
buildAMD({
|
buildAMD({
|
||||||
base: 'language/json',
|
base: 'language/json',
|
||||||
|
|
@ -118,7 +120,8 @@ buildAMD({
|
||||||
buildAMD({
|
buildAMD({
|
||||||
base: 'language/json',
|
base: 'language/json',
|
||||||
entryPoint: 'src/language/json/jsonMode.ts',
|
entryPoint: 'src/language/json/jsonMode.ts',
|
||||||
amdModuleId: 'vs/language/json/jsonMode'
|
amdModuleId: 'vs/language/json/jsonMode',
|
||||||
|
external: ['*/monaco.contribution']
|
||||||
});
|
});
|
||||||
buildAMD({
|
buildAMD({
|
||||||
base: 'language/json',
|
base: 'language/json',
|
||||||
|
|
@ -142,7 +145,7 @@ buildESM({
|
||||||
'src/language/typescript/tsMode.ts',
|
'src/language/typescript/tsMode.ts',
|
||||||
'src/language/typescript/ts.worker.ts'
|
'src/language/typescript/ts.worker.ts'
|
||||||
],
|
],
|
||||||
external: ['monaco-editor-core', '*/tsMode']
|
external: ['monaco-editor-core', '*/tsMode', '*/monaco.contribution']
|
||||||
});
|
});
|
||||||
buildAMD({
|
buildAMD({
|
||||||
base: 'language/typescript',
|
base: 'language/typescript',
|
||||||
|
|
@ -153,7 +156,8 @@ buildAMD({
|
||||||
buildAMD({
|
buildAMD({
|
||||||
base: 'language/typescript',
|
base: 'language/typescript',
|
||||||
entryPoint: 'src/language/typescript/tsMode.ts',
|
entryPoint: 'src/language/typescript/tsMode.ts',
|
||||||
amdModuleId: 'vs/language/typescript/tsMode'
|
amdModuleId: 'vs/language/typescript/tsMode',
|
||||||
|
external: ['*/monaco.contribution']
|
||||||
});
|
});
|
||||||
buildAMD({
|
buildAMD({
|
||||||
base: 'language/typescript',
|
base: 'language/typescript',
|
||||||
|
|
|
||||||
|
|
@ -155,9 +155,15 @@ exports.buildESM = buildESM;
|
||||||
* entryPoint: string;
|
* entryPoint: string;
|
||||||
* amdModuleId: string;
|
* amdModuleId: string;
|
||||||
* amdDependencies?: string[];
|
* amdDependencies?: string[];
|
||||||
|
* external?: string[];
|
||||||
* }} options
|
* }} options
|
||||||
*/
|
*/
|
||||||
function buildOneAMD(type, options) {
|
function buildOneAMD(type, options) {
|
||||||
|
if (!options.amdDependencies) {
|
||||||
|
options.amdDependencies = [];
|
||||||
|
}
|
||||||
|
options.amdDependencies.unshift('require');
|
||||||
|
|
||||||
/** @type {import('esbuild').BuildOptions} */
|
/** @type {import('esbuild').BuildOptions} */
|
||||||
const opts = {
|
const opts = {
|
||||||
entryPoints: [options.entryPoint],
|
entryPoints: [options.entryPoint],
|
||||||
|
|
@ -169,9 +175,9 @@ function buildOneAMD(type, options) {
|
||||||
},
|
},
|
||||||
globalName: 'moduleExports',
|
globalName: 'moduleExports',
|
||||||
banner: {
|
banner: {
|
||||||
js: `${bundledFileHeader}define("${options.amdModuleId}",[${(options.amdDependencies || [])
|
js: `${bundledFileHeader}define("${options.amdModuleId}", [${(options.amdDependencies || [])
|
||||||
.map((dep) => `"${dep}"`)
|
.map((dep) => `"${dep}"`)
|
||||||
.join(',')}],()=>{`
|
.join(',')}],(require)=>{`
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
js: 'return moduleExports;\n});'
|
js: 'return moduleExports;\n});'
|
||||||
|
|
@ -184,7 +190,7 @@ function buildOneAMD(type, options) {
|
||||||
'monaco-editor-core': path.join(__dirname, '../src/fillers/monaco-editor-core-amd.ts')
|
'monaco-editor-core': path.join(__dirname, '../src/fillers/monaco-editor-core-amd.ts')
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
external: ['vs/editor/editor.api']
|
external: ['vs/editor/editor.api', ...(options.external || [])]
|
||||||
};
|
};
|
||||||
if (type === 'min') {
|
if (type === 'min') {
|
||||||
opts.minify = true;
|
opts.minify = true;
|
||||||
|
|
@ -198,6 +204,7 @@ function buildOneAMD(type, options) {
|
||||||
* entryPoint: string;
|
* entryPoint: string;
|
||||||
* amdModuleId: string;
|
* amdModuleId: string;
|
||||||
* amdDependencies?: string[];
|
* amdDependencies?: string[];
|
||||||
|
* external?: string[];
|
||||||
* }} options
|
* }} options
|
||||||
*/
|
*/
|
||||||
function buildAMD(options) {
|
function buildAMD(options) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue