chengcyber/rollup-plugin-monaco-editor(新しいタブで開きます)
主要言語: JavaScript
A rollup plugin for importing monaco editor
- star 数
- 29
- watcher 数
- 4
- fork 数
- 3
- issue 数
- 3
- 最終更新
- 2023/11/08
主要言語: JavaScript
A rollup plugin for importing monaco editor
A rollup plugin to import monaco editor
Online demo: https://chengcyber.github.io/rollup-plugin-monaco-editor/
For now, this plugin supports monaco-editor@^0.21.*.
The following versions have been tested locally:
0.21.20.22.30.24.00.25.00.26.10.27.00.29.10.30.10.31.10.34.0This plugin should be used with other plugins. including
@rollup/plugin-node-resolverollup-plugin-postcss (or other plugin can handle .css files)@rollup/plugin-commonjs// rollup.config.js 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'; export default { output: { format: 'es', dir: 'dist', }, // ...other config plugins: [ // ...other plugins // handle .css files postcss(), monaco({ languages: ['json'], }), nodeResolve(), commonjs(), ], };
Plugin options can be passed in to rollup-plugin-monaco-editor. They can be used to generate a smaller editor bundle by selecting only certain languages or only certain editor features:
Type: string[]
Default: All available languages depends on the version of monaco-editor installed.
Example:
monaco({ languages: ['json'], }); monaco({ languages: ['html', 'css', 'javascript'], });
Type: string
Default: All available features depends on the version of monaco-editor installed.
Example:
monaco({ features: ['contextmenu'], }); monaco({ features: ['rename'], });
Type: boolean
Default: true if rollup.outputOptions.format is esm or es, otherwise false.
Type: string
Default: rollup.outputOptions.dir with leading slash.
Type: boolean
Default: true
You can set sourcemap to false to disable generate sourcemap. It makes build faster.
NOTE: pnpm@6 is used to manage this package
pnpm install
pnpm build
pnpm build:example
pnpm start:example
visit http://localhost:8080 to see the simple demo.
pnpm start
MIT @chengcyber