Skip to content

Commit 1ebdcee

Browse files
bollwyvljtpio
authored andcommitted
add lazy loading
1 parent 75d3476 commit 1ebdcee

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

{{cookiecutter.github_project_name}}/src/plugin.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import { Widget } from '@phosphor/widgets';
77

88
import { IJupyterWidgetRegistry } from '@jupyter-widgets/base';
99

10-
import * as widgetExports from './widget';
11-
1210
import { MODULE_NAME, MODULE_VERSION } from './version';
1311

1412
const EXTENSION_ID = '{{ cookiecutter.npm_package_name }}:plugin';
@@ -37,6 +35,6 @@ function activateWidgetExtension(
3735
registry.registerWidget({
3836
name: MODULE_NAME,
3937
version: MODULE_VERSION,
40-
exports: widgetExports,
38+
exports: async () => import(/* webpackChunkName: "{{ cookiecutter.npm_package_name }}" */ './widget'),
4139
});
4240
}

{{cookiecutter.github_project_name}}/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"declaration": true,
44
"esModuleInterop":true,
55
"lib": ["es2015", "dom"],
6-
"module": "commonjs",
6+
"module": "esnext",
77
"moduleResolution": "node",
88
"noEmitOnError": true,
99
"noUnusedLocals": true,

0 commit comments

Comments
 (0)