-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
57 lines (55 loc) · 1.38 KB
/
next.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
48
49
50
51
52
53
54
55
56
57
/*
* Copyright (c) 2021-2023 Datalayer, Inc.
*
* MIT License
*/
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
webpack: (config, options) => {
config.module.rules.push(
{ test: /\.js.map$/, type: 'asset/resource' },
{
// In .css files, svg is loaded as a data URI.
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
issuer: /\.css$/,
use: {
loader: 'svg-url-loader',
options: { encoding: 'none', limit: 10000 },
},
},
{
// In .ts and .tsx files (both of which compile to .js), svg files
// must be loaded as a raw string instead of data URIs.
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
issuer: /\.js$/,
type: 'asset/source',
},
// Ship the JupyterLite service worker.
{
resourceQuery: /text/,
type: 'asset/resource',
generator: {
filename: '[name][ext]',
},
},
// Rule for pyodide kernel
{
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]',
},
},
)
return config
},
}
module.exports = nextConfig