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

Stable way to get script path for split bundles #12191

Merged
merged 1 commit into from
Jun 8, 2020
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
2 changes: 0 additions & 2 deletions src/client/datascience/notebook/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export class NotebookOutputRenderer implements VSCNotebookOutputRenderer {
private _preloads: Uri[] = [];
constructor() {
const renderersFolder = path.join(EXTENSION_ROOT_DIR, 'out', 'datascience-ui', 'renderers');
this._preloads.push(Uri.file(path.join(renderersFolder, 'pvscDummy.js')));
this._preloads.push(Uri.file(path.join(renderersFolder, 'main.js')));
this._preloads.push(Uri.file(path.join(renderersFolder, 'renderers.js')));
}

Expand Down
13 changes: 5 additions & 8 deletions src/datascience-ui/renderers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
'use strict';

// This must be on top, do not change. Required by webpack.
// tslint:disable-next-line: no-var-requires no-require-imports
// require('../common/main');
declare let __webpack_public_path__: string;
const getPublicPath = () => {
const currentDirname = (document.currentScript as HTMLScriptElement).src.replace(/[^/]+$/, '');
return new URL(currentDirname).toString();
};

// tslint:disable-next-line: no-any
if ((window as any).__PVSC_Public_Path) {
// This variable tells Webpack to this as the root path used to request webpack bundles.
// tslint:disable-next-line: no-any
__webpack_public_path__ = (window as any).__PVSC_Public_Path;
}
__webpack_public_path__ = getPublicPath();
// This must be on top, do not change. Required by webpack.

import type { nbformat } from '@jupyterlab/coreutils';
Expand Down
26 changes: 0 additions & 26 deletions src/datascience-ui/renderers/main.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/datascience-ui/renderers/pvscDummy.ts

This file was deleted.