Skip to content

Commit

Permalink
πŸ§‘πŸΎβ€πŸ­ override default jupyterlite service worker (#710)
Browse files Browse the repository at this point in the history
* πŸͺ“ reduced jlite service worker - no caching
* πŸ—sw build config
* πŸ‘†πŸ»ack & 🧹 tidy
* πŸ“— changeset
  • Loading branch information
stevejpurves authored Nov 21, 2023
1 parent 93c32dd commit 1ce79f6
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/heavy-ravens-crash.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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

0 comments on commit 1ce79f6

Please sign in to comment.