Skip to content
This repository has been archived by the owner on Feb 23, 2020. It is now read-only.

Commit

Permalink
Webpack workaround for Web3 bundling
Browse files Browse the repository at this point in the history
This is a known issue: web3/web3.js#1105
  • Loading branch information
namesty committed Dec 11, 2019
1 parent c863dc2 commit bd236e2
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions examples/subgraph/src/mutations/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
const webpack = require("webpack")
const path = require("path");
const nodeExternals = require('webpack-node-externals');

module.exports = {
entry: "./src/index.ts",
target: 'node',
externals: {
"graphql-tag" : "gql",
"web3": "Web3",
"ipfs-http-client": "IPFSClient"
externals: ["fs", "bindings", "any-promise"],
resolve: {
extensions: ['*', '.js', '.ts'],
alias: {
'scrypt.js': path.resolve(__dirname, './node_modules/scrypt.js/js.js'),
'swarm-js': path.resolve(__dirname, './node_modules/swarm-js/lib/api-browser.js'),
'fs': path.resolve(__dirname, './src/app/fs-fake.js'),
}
},
plugins: [
new webpack.IgnorePlugin(/^(?:electron|ws)$/)
],
module: {
rules: [
{
Expand All @@ -25,9 +32,6 @@ module.exports = {
}
]
},
resolve: {
extensions: ['*', '.js', '.ts'],
},
output: {
library: 'Resolvers',
filename: "index.js",
Expand Down

0 comments on commit bd236e2

Please sign in to comment.