Registry / web-framework / esbuild-monaco-editor-plugin

esbuild-monaco-editor-plugin

JSON →
library0.1.1jsnpmunverified

esbuild plugin for integrating Monaco Editor (v0.1.1). It configures esbuild to handle Monaco's web workers and language assets. The plugin is incomplete; imports from 'editor.api.js' require manual language imports, while 'editor.main.js' loads all languages. Alternative to webpack-based Monaco plugins. Low release cadence.

npm install esbuild-monaco-editor-plugin
INSTALL
IMPORT
SIG · ESBUILD-MONACO-EDI
E
esbuild-monaco-editor-plugin
web-frameworkjavascriptv0.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const monacoEditorPlugin = require('esbuild-monaco-editor-plugin');
import monacoEditorPlugin from 'esbuild-monaco-editor-plugin';
Package is CommonJS-only; ESM import may fail.
monacoEditorPlugin
import monacoEditorPlugin from 'esbuild-monaco-editor-plugin'; // If using bundler with CJS interop
import { monacoEditorPlugin } from 'esbuild-monaco-editor-plugin';
It's a default export, not named.

Shows how to use the plugin in an esbuild build script.

const esbuild = require('esbuild'); const monacoEditorPlugin = require('esbuild-monaco-editor-plugin'); esbuild.build({ entryPoints: ['src/app.js'], bundle: true, outdir: 'dist', plugins: [monacoEditorPlugin], }).catch(() => process.exit(1));
Debug
Known issues
gotchaPlugin does not handle language workers automatically when importing from 'editor.api.js'
fix
Import from 'editor.main.js' instead, or manually load language features.
affects: >=0.0.0
deprecatedMisspelled '--wtach' in example code
fix
Use correct flag '--watch'.
affects: >=0.1.1
gotchaPlugin may not work with newer esbuild versions due to internal changes.
fix
Check compatibility; consider alternatives like 'monaco-editor-esbuild'.
affects: >=0.1.1
gotchaTypo in example: 'ebuild.build' instead of 'esbuild.build'.
fix
Correct to 'esbuild.build()'.
affects: >=0.1.1
Errors
Common errors & fixes
Error: Cannot find module 'monaco-editor/esm/vs/editor/editor.api.js'
Plugin does not resolve Monaco editor source files correctly.
fix
Ensure monaco-editor is installed and import from 'monaco-editor/esm/vs/editor/editor.main.js'.
Error: The plugin 'esbuild-monaco-editor-plugin' is not a function
Importing with named import instead of default.
fix
Use default import: const monacoEditorPlugin = require('esbuild-monaco-editor-plugin');
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
esbuildrequiredpeer dependency for plugin usage
Agent activity
4 hits · last 30 days
node
4
Resources
esbuild-monaco-editor-plugin — npm install esbuild-monaco-editor-plugin · libregistry