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

🧑🏾‍🏭 override default jupyterlite service worker #710

Merged
merged 4 commits into from Nov 21, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/heavy-ravens-crash.md
@@ -0,0 +1,5 @@
---
'thebe-lite': minor
---

Added a custom service worker for jupyterlite based on the default jupyterlite sw but with no caching, added build steps for this to be included in `thebe-lite` builds.
2 changes: 1 addition & 1 deletion packages/lite/src/jlite.ts
@@ -1,7 +1,7 @@
import type { ServiceManager } from '@jupyterlab/services';
import type { LiteServerConfig } from './types';
import { PageConfig } from '@jupyterlab/coreutils';
import { JupyterLiteServer } from '@jupyterlite/server';
import { LiteServerConfig } from './types';

const serverExtensions = [import('@jupyterlite/server-extension')];

Expand Down
83 changes: 83 additions & 0 deletions packages/lite/src/service-worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions packages/lite/webpack.config.cjs
Expand Up @@ -35,6 +35,10 @@ module.exports = {
to: 'pypi',
context: path.dirname(require.resolve('@jupyterlite/pyodide-kernel')),
},
{
from: './src/service-worker.js',
to: './',
},
],
}),
],
Expand All @@ -58,6 +62,13 @@ module.exports = {
use: 'ts-loader',
exclude: /node_modules/,
},
{
resourceQuery: /text/,
type: 'asset/resource',
generator: {
filename: '[name][ext]',
},
},
],
},
resolve: {
Expand Down