-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.lab-config.js
47 lines (46 loc) · 1.26 KB
/
webpack.lab-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* Copyright (c) 2021-2023 Datalayer, Inc.
*
* MIT License
*/
module.exports = {
module: {
rules: [
{
test: /\.jsx$/,
loader: 'babel-loader',
options: {
presets: ['@babel/preset-react'],
cacheDirectory: true
}
},
// 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: {
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]',
},
},
],
},
};