Giter VIP home page Giter VIP logo

Comments (4)

micaww avatar micaww commented on July 22, 2024 6

Hey all, I've found the issue.

Check out the usage for Monaco Editor Webpack Plugin.

react-monaco-editor should be using:

import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'

but it uses

import * as monaco from 'monaco-editor'

instead. This forces monaco-editor-webpack-plugin to build the entire editor instead of only what you tell it.

I've solved this issue by adding an alias for monaco-editor in my webpack.config.js:

const path = require('path');
const webpack = require('webpack');
const MonacoEditorPlugin = require('monaco-editor-webpack-plugin');

module.exports = {
    mode: 'development',
    entry: './src/app.js',
    devtool: 'source-map',
    output: {
        path: path.resolve('dist'),
        filename: 'app.js'
    },
    module: {
        rules: [{
            test: /\.css$/,
            use: ['style-loader', 'css-loader']
        }]
    },
    // ALIAS
    resolve: {
        alias: {
            'monaco-editor': 'monaco-editor/esm/vs/editor/editor.api.js'
        }
    },
    plugins: [
        new MonacoEditorPlugin({
            languages: ['javascript', 'typescript'],
            features: []
        })
    ]
};

This issue should be closed as it has nothing to do with monaco-editor-webpack-plugin

from monaco-editor-webpack-plugin.

ulrichb avatar ulrichb commented on July 22, 2024 1

Same here.

Also features: ['!toggleHighContrast', '!accessibilityHelp', '!contextmenu', '!codelens'] doesn't seem to work.

from monaco-editor-webpack-plugin.

micaww avatar micaww commented on July 22, 2024

I have the same issue with the same setup. Is there any temporary workaround to force those bundles to not be generated?

from monaco-editor-webpack-plugin.

harlanwei avatar harlanwei commented on July 22, 2024

I ran into the same problem just a few minutes ago. I actually thought something was wrong with my webpack...

from monaco-editor-webpack-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.