An extensible library to highlight (and comment) JSX syntax in the Monaco Editor using Babel. It exposes its AST, so you can add your own syntax-based or custom highlights.
I fllow the tutorial from npm,but an Error
it is beacause of babel core use process.env.BABEL_TYPES_8_BREAKINGandprocess is not in the browser enviroment
maybe the problem is i use vite and rolleup plugin ?code from rollup-plugin-monaco-editor
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import postcss from 'rollup-plugin-postcss'
import commonjs from '@rollup/plugin-commonjs'
import monaco from 'rollup-plugin-monaco-editor'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
postcss(),
monaco({
languages: ['javascript']
}),
nodeResolve(),
commonjs()
],
server: {
host: '0.0.0.0',
port: 8991,
https: false
}
})
I fllow the tutorial from npm,but an Error it is beacause of babel core use
process.env.BABEL_TYPES_8_BREAKING
andprocess
is not in the browser enviroment maybe the problem is i use vite and rolleup plugin ?code from rollup-plugin-monaco-editor