mirror of
https://github.com/readest/readest.git
synced 2026-11-29 19:02:28 +00:00
fix(build): keep music-metadata out of the web server bundle (#6699)
music-metadata 12.1.0 pulls in file-type 22, which loads strtok3 through a
webpackIgnore'd dynamic import. Webpack leaves a bare `import("strtok3")`
in the server chunk, and the OpenNext esbuild pass then fails with
`Could not resolve "strtok3"` because strtok3 is not a direct dependency.
music-metadata only parses user-picked audiobook files in the browser, so
alias it to false for the web server build, as jieba-wasm already is.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c307cfd79b
commit
6025a29c80
1 changed files with 8 additions and 1 deletions
|
|
@ -84,8 +84,15 @@ const nextConfig = {
|
|||
// can't find fflate (only installed in this app's node_modules).
|
||||
fflate: path.resolve(__dirname, 'node_modules/fflate'),
|
||||
...(appPlatform !== 'web' ? { '@readest/turso-database-wasm/webpack': false } : {}),
|
||||
// music-metadata only parses user-picked files in the browser; its
|
||||
// file-type dependency leaves a webpackIgnore'd `import('strtok3')` in
|
||||
// the server bundle that the OpenNext esbuild pass cannot resolve.
|
||||
...(isServer && appPlatform === 'web'
|
||||
? { '@readest/turso-database-wasm/webpack': false, 'jieba-wasm': false }
|
||||
? {
|
||||
'@readest/turso-database-wasm/webpack': false,
|
||||
'jieba-wasm': false,
|
||||
'music-metadata': false,
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
return config;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue