Skip to content

tune(monaco-editor-webpack-plugin): replace editor.main.js #2865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ValeraS
Copy link
Contributor

@ValeraS ValeraS commented Dec 30, 2021

Usually editor functionality used as:

import * as monaco from 'monaco-editor';

this resolves to ./esm/vs/editor/editor.main.js in package.json.

editor.main.js includes all feature and languages. Because of this, webpack-plugin does not work as expected.

This PR proposes replacing editor.main.js with editor.api.js and requested features and languages.

Closes #2874

@ValeraS ValeraS force-pushed the balepas/webpack-plugin-loader branch from 8aef849 to b7006c1 Compare December 30, 2021 14:41
@hediet hediet requested review from alexdima and removed request for alexdima January 3, 2022 08:16
@hediet hediet assigned alexdima and unassigned alexdima Jan 3, 2022
@hediet
Copy link
Member

hediet commented Jan 3, 2022

Thanks for your PR! Can you please open an issue to describe the problem that this PR fixes?

@ValeraS
Copy link
Contributor Author

ValeraS commented Jan 3, 2022

Thanks for your PR! Can you please open an issue to describe the problem that this PR fixes?

Should I open an issue with text from the first comment or should I describe something more fully?

@hediet
Copy link
Member

hediet commented Jan 3, 2022

Please also describe what you mean with "does not work as expected". Thank you!

@ValeraS
Copy link
Contributor Author

ValeraS commented Jan 3, 2022

Maybe also need to change this line

test: /esm[/\\]vs[/\\]editor[/\\]editor.(api|main).js/,
to check only editor.main.js

@hediet hediet added this to the January 2022 milestone Feb 3, 2022
@hediet
Copy link
Member

hediet commented Feb 3, 2022

Great idea!

To test this change, we adopted the smoke-test to import monaco-editor (instead of ./esm/vs/editor/editor.api.js), but unfortunately this breaks CI now.
Can you look into it?

Thank you!

@hediet hediet modified the milestones: January 2022, February 2022 Feb 3, 2022
hediet
hediet previously approved these changes Aug 3, 2022
@yaohwu
Copy link

yaohwu commented Sep 8, 2022

👍 👀

@jmroon
Copy link

jmroon commented Jan 31, 2023

Any chance we can bring this in? We deploy with our own custom language and it's unfortunate to be forced to bundle 89 languages along with it.

Alternatively, does someone have a reasonable workaround for the time being?

@stropalov
Copy link

We have the same issue, would be great to fix it.

@vladplesu
Copy link

It would be great to have this merged so please don't forget about this PR.

aeschli
aeschli previously approved these changes Aug 28, 2023
ValeraS and others added 3 commits August 28, 2023 23:19
Replace editor.main.js with editor.api.js and requested features and languages
BREAKING CHANGES:
if a project contains only these imports for creating editor:
```
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
const editor = monaco.editor.create(...);
```
`monaco-editor-webpack-plugin` will not add features and languages. When creating editor,
 monaco must be imported from package itself:
 ```
 import * as monaco from 'monaco-editor';
 const editor = monaco.editor.create(...);
 ```
@ValeraS ValeraS dismissed stale reviews from aeschli and hediet via 2d60530 August 28, 2023 21:55
@ValeraS ValeraS force-pushed the balepas/webpack-plugin-loader branch from 97fdb73 to 2d60530 Compare August 28, 2023 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] When using monaco-editor with webpack-plugin, webpack bundles all features and languages
8 participants