Skip to content

Commit

Permalink
add requirejs global var in rendering webview.
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornix committed Sep 24, 2020
1 parent 42e97f3 commit ddc98c3
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,11 @@ export class BackLayerWebView extends Disposable {
const baseUrl = asWebviewUri(this.environmentService, this.id, dirname(this.documentUri));

if (!isWeb) {
coreDependencies = `<script src="${loader}"></script>`;
coreDependencies = `<script src="${loader}"></script><script>
var requirejs = (function() {
return require;
}());
</script>`;
const htmlContent = this.generateContent(CELL_OUTPUT_PADDING, coreDependencies, baseUrl.toString());
this.initialize(htmlContent);
resolveFunc!();
Expand All @@ -384,6 +388,11 @@ export class BackLayerWebView extends Disposable {
<script>
${loaderJs}
</script>
<script>
var requirejs = (function() {
return require;
}());
</script>
`;

const htmlContent = this.generateContent(CELL_OUTPUT_PADDING, coreDependencies, baseUrl.toString());
Expand Down

0 comments on commit ddc98c3

Please sign in to comment.