Skip to content
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

Load script in body #10947

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ export class FrontendGenerator extends AbstractGenerator {
<html lang="en">

<head>${this.compileIndexHead(frontendModules)}
<script type="text/javascript" src="./bundle.js" charset="utf-8"></script>
</head>

<body>
<div class="theia-preload">${this.compileIndexPreload(frontendModules)}</div>
<div class="theia-preload">${this.compileIndexPreload(frontendModules)}</div>
<script type="text/javascript" src="./bundle.js" charset="utf-8"></script>
</body>

</html>`;
Expand Down
1 change: 1 addition & 0 deletions doc/Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Two kinds of changes may be required to consume Monaco using ESM modules.
- If your application uses its own Webpack config rather than that generated by the @theia/dev-packages, you
will need to update that config to remove the `CopyWebpackPlugin` formerly used to place Monaco
code in the build folder and to build a separate entrypoint for the `editor.worker`. See [the changes here](https://github.com/eclipse-theia/theia/pull/10736/files#diff-b4677f3ff57d8b952eeefc10493ed3600d2737f9b5c9b0630b172472acb9c3a2)
- If your application uses its own frontend generator, you should modify the code that generates the `index.html` to load the `script` containing the bundle into the `body` element rather than the head. See [changes here](https://github.com/eclipse-theia/theia/pull/10947/files)
- References to the `window.monaco` object should be replaced with imports from `@theia/monaco-editor-core`. In most cases, simply adding an import `import * as monaco from
'@theia/monaco-editor-core'` will suffice. More complex use cases may require imports from specific parts of Monaco. Please see
[the PR](https://github.com/eclipse-theia/theia/pull/10736) for details, and please post any questions or problems there.
Expand Down