fix(web): add browser fs fallback in Next webpack config
Prevent client builds from resolving Node's fs module when loading html-to-docx in workspace editors.
This commit is contained in:
parent
cd7ea43a91
commit
bc6a4d5a37
@ -19,7 +19,13 @@ const nextConfig: NextConfig = {
|
||||
// Transpile ESM-only packages so webpack can bundle them
|
||||
transpilePackages: ["react-markdown", "remark-gfm"],
|
||||
|
||||
webpack: (config, { dev }) => {
|
||||
webpack: (config, { dev, isServer }) => {
|
||||
if (!isServer) {
|
||||
config.resolve.fallback = {
|
||||
...config.resolve.fallback,
|
||||
fs: false,
|
||||
};
|
||||
}
|
||||
if (dev) {
|
||||
config.watchOptions = {
|
||||
...config.watchOptions,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user