Browse Source

prevent warning

Yuki Takei 3 năm trước cách đây
mục cha
commit
f4a28d286b
1 tập tin đã thay đổi với 11 bổ sung0 xóa
  1. 11 0
      packages/app/next.config.js

+ 11 - 0
packages/app/next.config.js

@@ -17,8 +17,19 @@ const nextConfig = {
     tsconfigPath: 'tsconfig.build.client.json',
   },
 
+  /** @param config {import('next').NextConfig} */
   webpack(config, options) {
 
+    // Avoid "Module not found: Can't resolve 'fs'"
+    // See: https://stackoverflow.com/a/68511591
+    if (!options.isServer) {
+      config.resolve.fallback.fs = false;
+    }
+
+    // See: https://webpack.js.org/configuration/externals/
+    // This provides a way of excluding dependencies from the output bundles
+    config.externals.push('dtrace-provider');
+
     // configure additional entries
     const orgEntry = config.entry;
     config.entry = () => {