| 40 | }, |
| 41 | |
| 42 | webpack(config, { isServer }) { |
| 43 | // Web Worker support |
| 44 | config.module.rules.push({ |
| 45 | test: /\.worker\.(ts|js)$/, |
| 46 | use: [ |
| 47 | { |
| 48 | loader: "worker-loader", |
| 49 | options: { |
| 50 | filename: "static/workers/[name].[contenthash].js", |
| 51 | publicPath: "/_next/", |
| 52 | }, |
| 53 | }, |
| 54 | ], |
| 55 | }); |
| 56 | |
| 57 | // Ignore node-specific modules in browser bundle |
| 58 | if (!isServer) { |
| 59 | config.resolve.fallback = { |
| 60 | ...config.resolve.fallback, |
| 61 | fs: false, |
| 62 | path: false, |
| 63 | os: false, |
| 64 | }; |
| 65 | } |
| 66 | |
| 67 | return config; |
| 68 | }, |
| 69 | }; |
| 70 | |
| 71 | export default withBundleAnalyzer(nextConfig); |