|
@@ -5,9 +5,7 @@
|
|
|
|
|
|
//@ts-check
|
|
//@ts-check
|
|
|
|
|
|
-const alias = require('esbuild-plugin-alias');
|
|
|
|
-const path = require('path');
|
|
|
|
-const { removeDir, tsc, dts, build, buildESM } = require('../build/utils');
|
|
|
|
|
|
+const { removeDir, tsc, dts, buildESM, buildAMD } = require('../build/utils');
|
|
|
|
|
|
removeDir(`monaco-html/release`);
|
|
removeDir(`monaco-html/release`);
|
|
removeDir(`monaco-html/out`);
|
|
removeDir(`monaco-html/out`);
|
|
@@ -22,58 +20,17 @@ dts(
|
|
|
|
|
|
buildESM({
|
|
buildESM({
|
|
entryPoints: ['src/monaco.contribution.ts', 'src/htmlMode.ts', 'src/html.worker.ts'],
|
|
entryPoints: ['src/monaco.contribution.ts', 'src/htmlMode.ts', 'src/html.worker.ts'],
|
|
- external: ['monaco-editor-core', '*/htmlMode'],
|
|
|
|
|
|
+ external: ['monaco-editor-core', '*/htmlMode']
|
|
|
|
+});
|
|
|
|
+buildAMD({
|
|
|
|
+ entryPoint: 'src/monaco.contribution.ts',
|
|
|
|
+ banner: 'define("vs/language/html/monaco.contribution",["vs/editor/editor.api"],()=>{'
|
|
|
|
+});
|
|
|
|
+buildAMD({
|
|
|
|
+ entryPoint: 'src/htmlMode.ts',
|
|
|
|
+ banner: 'define("vs/language/html/htmlMode",["vs/editor/editor.api"],()=>{'
|
|
|
|
+});
|
|
|
|
+buildAMD({
|
|
|
|
+ entryPoint: 'src/htmlWorker.ts',
|
|
|
|
+ banner: 'define("vs/language/html/htmlWorker",[],()=>{'
|
|
});
|
|
});
|
|
-
|
|
|
|
-/**
|
|
|
|
- * @param {'dev'|'min'} type
|
|
|
|
- * @param {string} entryPoint
|
|
|
|
- * @param {string} banner
|
|
|
|
- */
|
|
|
|
-function buildOneAMD(type, entryPoint, banner) {
|
|
|
|
- /** @type {import('esbuild').BuildOptions} */
|
|
|
|
- const options = {
|
|
|
|
- entryPoints: [entryPoint],
|
|
|
|
- bundle: true,
|
|
|
|
- target: 'esnext',
|
|
|
|
- format: 'iife',
|
|
|
|
- define: {
|
|
|
|
- AMD: 'true'
|
|
|
|
- },
|
|
|
|
- external: ['*/htmlMode'],
|
|
|
|
- globalName: 'moduleExports',
|
|
|
|
- banner: {
|
|
|
|
- js: banner
|
|
|
|
- },
|
|
|
|
- footer: {
|
|
|
|
- js: 'return moduleExports;\n});'
|
|
|
|
- },
|
|
|
|
- outdir: `release/${type}/`,
|
|
|
|
- plugins: [
|
|
|
|
- alias({
|
|
|
|
- 'vscode-nls': path.join(__dirname, '../build/fillers/vscode-nls.ts'),
|
|
|
|
- 'monaco-editor-core': path.join(__dirname, '../build/fillers/monaco-editor-core-amd.ts')
|
|
|
|
- })
|
|
|
|
- ]
|
|
|
|
- };
|
|
|
|
- if (type === 'min') {
|
|
|
|
- options.minify = true;
|
|
|
|
- }
|
|
|
|
- build(options);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * @param {string} entryPoint
|
|
|
|
- * @param {string} banner
|
|
|
|
- */
|
|
|
|
-function buildAMD(entryPoint, banner) {
|
|
|
|
- buildOneAMD('dev', entryPoint, banner);
|
|
|
|
- buildOneAMD('min', entryPoint, banner);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-buildAMD(
|
|
|
|
- 'src/monaco.contribution.ts',
|
|
|
|
- 'define("vs/language/html/monaco.contribution",["vs/editor/editor.api"],()=>{'
|
|
|
|
-);
|
|
|
|
-buildAMD('src/htmlMode.ts', 'define("vs/language/html/htmlMode",["vs/editor/editor.api"],()=>{');
|
|
|
|
-buildAMD('src/htmlWorker.ts', 'define("vs/language/html/htmlWorker",[],()=>{');
|
|
|