All Projects → wang12124468 → monaco-editor-esm-webpack-plugin

wang12124468 / monaco-editor-esm-webpack-plugin

Licence: other
No description or website provided.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to monaco-editor-esm-webpack-plugin

webpack-demos
webpack小练习
Stars: ✭ 17 (-32%)
Mutual labels:  webpack-plugin
V2releases
A friendly ARM assembler and simulator for educational use
Stars: ✭ 46 (+84%)
Mutual labels:  monaco-editor
Operational-Transformation
A collection of Algorithms to Synchronise changes across multiple clients using Operational Transformation
Stars: ✭ 25 (+0%)
Mutual labels:  monaco-editor
mock-webpack-plugin
A webpack plugin that starts a json mock server
Stars: ✭ 21 (-16%)
Mutual labels:  webpack-plugin
bower-resolve-webpack-plugin
Offers an enhanced bower support for enhanced-resolve plugin.
Stars: ✭ 12 (-52%)
Mutual labels:  webpack-plugin
chicio.github.io
👻 Fabrizio Duroni (me 😄) personal website. Created using GatsbyJS, Styled Components, Storybook, Typescript, tsParticles, GitHub pages, Github Actions, Upptime.
Stars: ✭ 20 (-20%)
Mutual labels:  webpack-plugin
del-webpack-plugin
A file plugin help you remove old files after webpack (v5) bundling
Stars: ✭ 43 (+72%)
Mutual labels:  webpack-plugin
emmet-monaco
Emmet support for monaco-editor
Stars: ✭ 19 (-24%)
Mutual labels:  monaco-editor
YWCLocalizeTool
No description or website provided.
Stars: ✭ 38 (+52%)
Mutual labels:  localize
loading-screen
🚥Loading screen for webpack plugin inspired by Nuxt.js's loading screen
Stars: ✭ 56 (+124%)
Mutual labels:  webpack-plugin
ZSpider
基于Electron爬虫程序
Stars: ✭ 37 (+48%)
Mutual labels:  monaco-editor
warnings-to-errors-webpack-plugin
a webpack plugin that can recognize every warning as errors.
Stars: ✭ 17 (-32%)
Mutual labels:  webpack-plugin
remove-files-webpack-plugin
A plugin for webpack that removes files and folders before and after compilation.
Stars: ✭ 48 (+92%)
Mutual labels:  webpack-plugin
qn-webpack
Qiniu webpack plugin (七牛 Webpack 插件)
Stars: ✭ 39 (+56%)
Mutual labels:  webpack-plugin
sprite
🖌 Draw charts in code. Render in real-time. Embed anywhere as .png.
Stars: ✭ 202 (+708%)
Mutual labels:  monaco-editor
crx-webpack-plugin
A webpack plugin to package chrome extensions (crx) post build
Stars: ✭ 21 (-16%)
Mutual labels:  webpack-plugin
targets-webpack-plugin
Webpack plugin for transcompilig final bundles so they support legacy browsers
Stars: ✭ 15 (-40%)
Mutual labels:  webpack-plugin
webpack-stats-diff-plugin
Webpack plugin for reporting changes in bundle sizes across builds
Stars: ✭ 63 (+152%)
Mutual labels:  webpack-plugin
bundle
An online tool to quickly bundle & minify your projects, while viewing the compressed gzip/brotli bundle size, all running locally on your browser.
Stars: ✭ 475 (+1800%)
Mutual labels:  monaco-editor
webpack-alioss-upload-plugin
A flexible webpack plugin to upload files to aliyun oss, which supports multiple optional upload methods and parameters.
Stars: ✭ 14 (-44%)
Mutual labels:  webpack-plugin

monaco-editor-esm-webpack-plugin

Change log

It dependency on monaco-editor-webpack-plugin.
If you want copy a monaco editor with localization, you can see primefaces-monaco

The webpack's plugin for monaco editor to compile the worker and handle with localization.

Installing

npm install monaco-editor-esm-webpack-plugin --save-dev

npm install monaco-editor monaco-editor-webpack-plugin monaco-editor-nls

Using

  • webpack.config.js

    const MonacoWebpackPlugin = require('monaco-editor-esm-webpack-plugin');
    
    module.exports = {
        entry: './index.js',
        output: {
            path: path.resolve(__dirname, 'dist'),
            filename: 'app.js'
        },
        module: {
            rules: [
                {
                    test: /\.js/,
                    enforce: 'pre',
                    include: /node_modules[\\\/]monaco-editor[\\\/]esm/,
                    use: MonacoWebpackPlugin.loader
                },
                {
                    test: /\.css$/,
                    use: ['style-loader', 'css-loader']
                }
            ]
        },
        plugins: [
            new MonacoWebpackPlugin()
        ]
    };
    

Localization

  • Set the locale data in your code

    // index.js
    import { setLocaleData } from 'monaco-editor-nls';
    import zh_CN from 'monaco-editor-nls/locale/zh-hans';
    
    setLocaleData(zh_CN);
    
    // You must import/require after `setLocaleData`
    // Do not use `import * as monaco from 'XXX'`, but can use `import('xxx').then(XXX)`
    const monaco = require('monaco-editor/esm/vs/editor/editor.api');
    
    monaco.editor.create(document.getElementById('root'), { language: 'javascript' });
    

Options

There only two options for this plugin. But you can set the monaco-editor-webpack-plugin's options in this options. such as: new MonacoWebpackPlugin({ languages: ['typescript'] })

  • isMonacoEditorWebapckPlugin - whether monaco-editor-webpack-plugin is used. Default: true

  • isReplaceNls - whether replace the nls file. Default: true

Q & A

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].