-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
52 lines (47 loc) · 1.2 KB
/
next.config.js
File metadata and controls
52 lines (47 loc) · 1.2 KB
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
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
trailingSlash: true,
images: {
unoptimized: true
},
eslint: {
ignoreDuringBuilds: true
},
webpack: (config, { isServer }) => {
// Handle @xenova/transformers for client-side usage
if (!isServer) {
config.resolve.alias = {
...config.resolve.alias,
// Force use of web version of ONNX runtime
'onnxruntime-node': false,
}
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
crypto: false,
module: false,
'sharp': false,
}
}
// Ignore native binary files and node-specific modules
config.module = config.module || {}
config.module.rules = config.module.rules || []
// Ignore .node native binary files
config.module.rules.push({
test: /\.node$/,
use: 'ignore-loader'
})
// Handle tesseract.js worker files
config.module.rules.push({
test: /\.worker\.js$/,
type: 'asset/resource',
generator: {
filename: 'static/[hash][ext][query]'
}
})
return config
},
}
module.exports = nextConfig