Socket
Socket
Sign inDemoInstall

rollup-plugin-monaco-editor

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-monaco-editor

> A rollup plugin to import monaco editor


Version published
Weekly downloads
127
decreased by-23.95%
Maintainers
1
Weekly downloads
 
Created
Source

rollup-plugin-monaco-editor

A rollup plugin to import monaco editor

Enviroment

  • monaco-editor: 0.21.2

NOTE: different version of monaco-editor has different feature definitions. This plugin just tests with 0.21.2 version for now.

Usage

This plugin should be used with other plugins. including

  • @rollup/plugin-node-resolve
  • rollup-plugin-postcss (or other plugin can handle .css files)
  • @rollup/plugin-commonjs
// rollup.config.js
import resolve 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 {
  // ...other config
  plugins: [
    // ...other plugins
    // handle .css files
    postcss(),
    monaco({
      esm: true, // true if you set output.format is esm
      pathPrefix: '/dist', // mostly same as output.dir with a prefix slash
      languages: ['json'],
    }),
    resolve({
      mainFields: [
        'exports',
        'browser:module',
        'browser',
        'module',
        'main',
      ].filter(Boolean),
      extensions: ['.mjs', '.cjs', '.js', '.json'], // Default: [ '.mjs', '.js', '.json', '.node' ]
      // whether to prefer built-in modules (e.g. `fs`, `path`) or local ones with the same names
      preferBuiltins: true, // Default: true
      dedupe: [], // userDefinedRollup.dedupe,
    }),
    commonjs(),
  ],
};

Example

yarn install
yarn build
yarn build:example
yarn start:example

visit http://localhost:8080 to see the simple demo.

Development

yarn start

LICENSE

MIT

Keywords

FAQs

Package last updated on 04 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc