diff --git a/next.config.js b/next.config.js new file mode 100644 index 0000000..dfdbd5d --- /dev/null +++ b/next.config.js @@ -0,0 +1,28 @@ +const path = require("path") +const CopyPlugin = require("copy-webpack-plugin") + +module.exports = { + // target: "serverless", + // future: { + // webpack5: true, + // }, + webpack: function (config, { dev, isServer }) { + // Fixes npm packages that depend on `fs` module + if (!isServer) { + config.resolve.fallback.fs = false + } + // Copy files to serverless functions + if (!dev) { + config.plugins.push( + new CopyPlugin({ + patterns: [{ + from: 'static', + to: 'static' + }], + }) + ) + } + + return config + }, +}