src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts/BackLayerWebView/createWebview
class BackLayerWebView:	async createWebview(): Promise<void> {
		const baseUrl = this.asWebviewUri(this.getNotebookBaseUri(), undefined);

		// Python notebooks assume that requirejs is a global.
		// For all other notebooks, they need to provide their own loader.
		if (!this.documentUri.path.toLowerCase().endsWith('.ipynb')) {
			const htmlContent = this.generateContent('', baseUrl.toString());
			this._initialize(htmlContent);
			return;
		}

		let coreDependencies = '';

		this._initialized = new DeferredPromise();
		this._webviewPreloadInitialized = new DeferredPromise();

		if (!isWeb) {
			const loaderUri = FileAccess.asFileUri('vs/loader.js');
			const loader = this.asWebviewUri(loaderUri, undefined);

			coreDependencies = `<script src="${loader}"></script><script>
			var requirejs = (function() {
				return require;
			}());
			</script>`;
			const htmlContent = this.generateContent(coreDependencies, baseUrl.toString());
			this._initialize(htmlContent);
			this._initialized.complete();
		} else {
			const loaderUri = FileAccess.asBrowserUri('vs/loader.js');

			fetch(loaderUri.toString(true)).then(async response => {
				if (response.status !== 200) {
					throw new Error(response.statusText);
				}

				const loaderJs = await response.text();

				coreDependencies = `
<script>
${loaderJs}
</script>
<script>
var requirejs = (function() {
	return require;
}());
</script>
`;

				const htmlContent = this.generateContent(coreDependencies, baseUrl.toString());
				this._initialize(htmlContent);
				this._initialized!.complete();
			}, error => {
				// the fetch request is rejected
				const htmlContent = this.generateContent(coreDependencies, baseUrl.toString());
				this._initialize(htmlContent);
				this._initialized!.complete();
			});
		}

		await this._initialized.p;
	}