Rollup Monaco Bundler

1.0.2 · maintenance · verified Tue Apr 21

rollup-monaco-bundler is a specialized Rollup utility designed to bundle `monaco-editor` dependencies, particularly focusing on generating UMD-formatted output. Its core differentiator is the provision for dynamic runtime National Language Support (NLS) injection, enabling `monaco-editor` to load language packs at runtime rather than bundling all of them upfront. The package, currently at version 1.0.2, appears to be in maintenance mode with its last notable activity around March 2025. Unlike other Monaco-specific Rollup plugins which might focus solely on bundling, this package explicitly targets the externalization of Monaco dependencies and efficient NLS handling for optimized bundle sizes in web applications. It's best suited for projects that require `monaco-editor` in a UMD context and need fine-grained control over internationalization.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates a basic Rollup configuration using `monacoNlsInject` to bundle `monaco-editor` with dynamic NLS, outputting a UMD bundle.

import { defineConfig } from 'rollup';
import { monacoNlsInject } from 'rollup-monaco-bundler';
import typescript from '@rollup/plugin-typescript';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';

export default defineConfig({
  input: 'src/index.ts',
  output: {
    dir: 'dist',
    format: 'umd',
    name: 'MonacoEditorBundle',
    sourcemap: true,
  },
  plugins: [
    nodeResolve(),
    commonjs(),
    typescript(),
    monacoNlsInject({
      locale: process.env.MONACO_LOCALE || 'en',
      // Other options like 'basePath', 'ignore' can be configured here.
      // Refer to the plugin documentation for full options.
    }),
    // Other Rollup plugins for CSS, assets, etc. may be needed
  ],
  external: [
    // List any modules that should not be bundled here, e.g., 'monaco-editor'
    // if you intend to load it separately or from a CDN.
  ]
});

view raw JSON →