diff --git a/package.json b/package.json index e906901..4e0f367 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "scripts": { "start": "react-scripts start", "bootstrap": "node ./init-faunadb.js", - "buildFunctions": "netlify-lambda build functions", + "buildFunctions": "netlify-lambda build functions -c ./webpack.config.js", "build": "npm run buildFunctions && react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject" diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..98505ee --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,11 @@ +var webpack = require("webpack"); + +/* fix for https://medium.com/@danbruder/typeerror-require-is-not-a-function-webpack-faunadb-6e785858d23b */ +module.exports = { + plugins: [ + new webpack.DefinePlugin({ "global.GENTLY": false }) + ], + node: { + __dirname: true, + } +}