mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 05:50:11 +01:00
fixes website & adds editor.api.d.ts (#5104)
This commit is contained in:
parent
36efbe07d9
commit
e70b6618f4
7 changed files with 26 additions and 24 deletions
|
|
@ -16,6 +16,7 @@ const root = join(import.meta.dirname, '../../');
|
|||
export default defineConfig({
|
||||
input: {
|
||||
entry: join(root, './src/editor/editor.main.ts'),
|
||||
editorApi: join(root, './src/editor/editor.api.ts'),
|
||||
},
|
||||
output: {
|
||||
dir: join(root, './out/monaco-editor/esm'),
|
||||
|
|
@ -41,6 +42,6 @@ export default defineConfig({
|
|||
},
|
||||
includeExternal: ['monaco-editor-core', '@vscode/monaco-lsp-client']
|
||||
}),
|
||||
dtsDeprecationWarning(),
|
||||
dtsDeprecationWarning(f => f.endsWith('editor.api.d.ts')),
|
||||
],
|
||||
});
|
||||
|
|
|
|||
|
|
@ -58,12 +58,18 @@ export function mapModuleId(moduleId, newExt) {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
/** @return {import('rollup').Plugin} */
|
||||
export function dtsDeprecationWarning() {
|
||||
/**
|
||||
* @param {(moduleId: string) => boolean} [filter]
|
||||
* @return {import('rollup').Plugin}
|
||||
*/
|
||||
export function dtsDeprecationWarning(filter) {
|
||||
return {
|
||||
name: 'add-dts-deprecation-warning',
|
||||
generateBundle(options, bundle) {
|
||||
for (const fileName in bundle) {
|
||||
if (filter && !filter(fileName)) {
|
||||
continue;
|
||||
}
|
||||
const file = bundle[fileName];
|
||||
if (file.type === 'chunk' && fileName.endsWith('.d.ts')) {
|
||||
let content = file.code.toString();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue