-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: webpack config for jupyuter lite
- Loading branch information
Showing
3 changed files
with
64 additions
and
0 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
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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) 2021-2023 Datalayer, Inc. | ||
* | ||
* MIT License | ||
*/ | ||
|
||
module.exports = { | ||
module: { | ||
rules: [ | ||
// Rule to deal with the service-worker.ts file | ||
// It will include the transpiled file as a text file named `[name][ext]` | ||
// That file is available from the static folder of this extension. That | ||
// requires to overwrite the `workerUrl` in '@datalayer/jupyter-kernels:browser-service-worker' | ||
// see https://github.com/jupyterlite/jupyterlite/blob/1a1bbcaab83f3c56fde6747a8c9b83d3c2a9eb97/packages/server/src/tokens.ts#L5 | ||
{ | ||
resourceQuery: /text/, | ||
type: 'asset/resource', | ||
generator: { | ||
// Must match the filename in jupyter_kernels/handlers/service_worker/handler.py | ||
filename: 'lite-[name][ext]', | ||
}, | ||
}, | ||
// Rules for pyodide kernel assets | ||
{ | ||
test: /pypi\/.*/, | ||
type: 'asset/resource', | ||
generator: { | ||
filename: 'pypi/[name][ext][query]', | ||
}, | ||
}, | ||
{ | ||
test: /pyodide-kernel-extension\/schema\/.*/, | ||
type: 'asset/resource', | ||
generator: { | ||
filename: 'schema/[name][ext][query]', | ||
}, | ||
}, | ||
], | ||
}, | ||
}; |