-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor extension.ts to use optional chaining for baseUrl
- Loading branch information
Showing
1 changed file
with
2 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,3 @@ | ||
// Copyright (c) Jupyter Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||
|
||
// Entry point for the notebook bundle containing custom model definitions. | ||
// | ||
// Setup notebook base URL | ||
// | ||
// Some static assets may be required by the custom widget javascript. The base | ||
// url for the notebook is not known at build time and is therefore computed | ||
// dynamically. | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
(window as any).__webpack_public_path__ = | ||
document.querySelector('body')!.getAttribute('data-base-url') + | ||
'nbextensions/ipychess'; | ||
|
||
const baseUrl = document.querySelector('body')?.getAttribute('data-base-url'); | ||
(window as any).__webpack_public_path__ = `${baseUrl}\nnbextensions/ipychess`; | ||
export * from './index'; |