suren-atoyan / monaco-react

Monaco Editor for React - use the monaco-editor in any React application without needing to use webpack (or rollup/parcel/etc) configuration files / plugins

Home Page:https://monaco-react.surenatoyan.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to exclude unnecessary files languages at build

JolianGof opened this issue · comments

I have a project where I am using monaco-react editor , where the user only write in JSON and javascript format, but when I build the project I get all the files in the dist -> assets folder such dart, java , etc... but I only want the necessary javascript and JSON files
by the way im using react with vite
here is my code
import { loader,Editor } from '@monaco-editor/react';

import * as monaco from 'monaco-editor';
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';

self.MonacoEnvironment = {
getWorker(_, label) {

if (label === 'typescript' || label === 'javascript') {
return new tsWorker();
}
return new editorWorker();
},
};

loader.config({ monaco });

return (

);