@@ -15,6 +15,8 @@ import nodeResolve from '@rollup/plugin-node-resolve';
1515import { urlToEsmPlugin } from './rollup-url-to-module-plugin/index.mjs' ;
1616import { copyFileSync , mkdirSync } from 'fs' ;
1717import { dirname } from 'path' ;
18+ import { fileURLToPath } from 'url' ;
19+ import { readdirSync } from 'fs' ;
1820
1921const root = join ( import . meta. dirname , '../../' ) ;
2022const outDir = join ( root , './out/monaco-editor/esm' ) ;
@@ -40,13 +42,27 @@ const mappedPaths = {
4042 [ join ( root , 'src/' ) ] : 'vs/' ,
4143} ;
4244
45+ function getNlsEntryPoints ( ) {
46+ // Scan for nls.messages.*.js files dynamically
47+ const nlsDir = dirname ( fileURLToPath ( import . meta. resolve ( 'monaco-editor-core/esm/nls.messages.en.js' ) ) ) ;
48+ const nlsFiles = readdirSync ( nlsDir )
49+ . filter ( file => file . startsWith ( 'nls.messages.' ) && file . endsWith ( '.js' ) )
50+ . reduce ( ( acc , file ) => {
51+ // @ts -ignore
52+ acc [ file ] = join ( nlsDir , file ) ;
53+ return acc ;
54+ } , { } ) ;
55+ return nlsFiles ;
56+ }
57+
4358export default defineConfig ( {
4459 input : {
4560 entry : join ( root , './src/editor/editor.main.ts' ) ,
4661 editorAll : join ( root , './src/editor/editor.all.ts' ) ,
4762 edcoreMain : join ( root , './src/editor/edcore.main.ts' ) ,
4863 editorApi : join ( root , './src/editor/editor.api.ts' ) ,
4964 editorWorker : join ( root , './src/editor/editor.worker.ts' ) ,
65+ ...getNlsEntryPoints ( ) ,
5066 } ,
5167
5268 output : {
0 commit comments