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

docs: fix js dependencies in webpack example #1027

Merged
merged 7 commits into from
Oct 22, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion examples/browser-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@
"babel-core": "^6.24.1",
"babel-loader": "^7.0.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wha does the babel-preset-stage-0 do and why do we need it here?

Copy link
Contributor Author

@dfguo dfguo Sep 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why it was included in the .babelrc https://github.com/ipfs/js-ipfs/blob/master/examples/browser-webpack/.babelrc

We can perhaps take that away if that wasn't needed too.

"json-loader": "^0.5.4",
"react": "^15.5.4",
"react-hot-loader": "^1.3.1",
"webpack": "^2.5.1",
"webpack-dev-server": "^2.4.5"
},
"dependencies": {
"ipfs": "^0.26.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still want to use IPFS from this repo - it needs to be something like:

"dependencies": {
   "ipfs": "../../../src/core",
   ....
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should be correct

"dependencies": {
   "ipfs": "file:../../",
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nice! Much better

"ipfs-block-service": "^0.12.0",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"safe-buffer": "^5.0.1"
}
}
4 changes: 2 additions & 2 deletions examples/browser-webpack/src/components/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

const React = require('react')
const Buffer = require('safe-buffer').Buffer
const IPFS = require('../../../../src/core') // replace this by line below
// const IPFS = require('ipfs')
// const IPFS = require('../../../../src/core') // replace this by line below
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this line now.

const IPFS = require('ipfs')

const stringToUse = 'hello world from webpacked IPFS'

Expand Down