add web pack build fix

This commit is contained in:
davidwells 2018-06-11 16:35:43 -07:00
parent be9f676de6
commit 55f2fc378c
2 changed files with 12 additions and 1 deletions

View file

@ -11,7 +11,7 @@
"scripts": { "scripts": {
"start": "react-scripts start", "start": "react-scripts start",
"bootstrap": "node ./init-faunadb.js", "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", "build": "npm run buildFunctions && react-scripts build",
"test": "react-scripts test --env=jsdom", "test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject" "eject": "react-scripts eject"

11
webpack.config.js Normal file
View file

@ -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,
}
}