File tree Expand file tree Collapse file tree 3 files changed +29
-18
lines changed
examples/upload-file-via-browser Expand file tree Collapse file tree 3 files changed +29
-18
lines changed Original file line number Diff line number Diff line change 1111 ],
1212 "license" : " MIT" ,
1313 "devDependencies" : {
14- "babel-core" : " ^5.4.7 " ,
15- "babel-loader" : " ^5.1.2 " ,
14+ "babel-core" : " ~6.26.3 " ,
15+ "babel-loader" : " ~8.0.4 " ,
1616 "ipfs-api" : " ../../" ,
17- "pull-file-reader" : " ^ 1.0.2" ,
18- "react" : " ^15.4.2 " ,
19- "react-dom" : " ^15.4.2 " ,
20- "react-hot-loader" : " ^1 .3.1 " ,
21- "webpack" : " ^2.0.0 " ,
22- "webpack-dev-server" : " ^1.8.2 "
17+ "pull-file-reader" : " ~ 1.0.2" ,
18+ "react" : " ~16.6.3 " ,
19+ "react-dom" : " ~16.6.3 " ,
20+ "react-hot-loader" : " ~4 .3.12 " ,
21+ "webpack" : " ~4.25.1 " ,
22+ "webpack-dev-server" : " ~3.1.10 "
2323 }
2424}
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class App extends React.Component {
2323 event . stopPropagation ( )
2424 event . preventDefault ( )
2525 const file = event . target . files [ 0 ]
26- if ( document . getElementById ( " keepFilename" ) . checked ) {
26+ if ( document . getElementById ( ' keepFilename' ) . checked ) {
2727 this . saveToIpfsWithFilename ( file )
2828 } else {
2929 this . saveToIpfs ( file )
@@ -63,7 +63,7 @@ class App extends React.Component {
6363 . then ( ( response ) => {
6464 console . log ( response )
6565 // CID of wrapping directory is returned last
66- ipfsId = response [ response . length - 1 ] . hash
66+ ipfsId = response [ response . length - 1 ] . hash
6767 console . log ( ipfsId )
6868 this . setState ( { added_file_hash : ipfsId } )
6969 } ) . catch ( ( err ) => {
@@ -80,7 +80,7 @@ class App extends React.Component {
8080 < div >
8181 < form id = 'captureMedia' onSubmit = { this . handleSubmit } >
8282 < input type = 'file' onChange = { this . captureFile } /> < br />
83- < label for = 'keepFilename' > < input type = 'checkbox' id = 'keepFilename' name = 'keepFilename' /> keep filename</ label >
83+ < label htmlFor = 'keepFilename' > < input type = 'checkbox' id = 'keepFilename' name = 'keepFilename' /> keep filename</ label >
8484 </ form >
8585 < div >
8686 < a target = '_blank'
Original file line number Diff line number Diff line change 11'use strict'
22
3- let path = require ( 'path' )
4- let webpack = require ( 'webpack' )
3+ const path = require ( 'path' )
4+ const webpack = require ( 'webpack' )
55
66module . exports = {
7+ mode : 'development' ,
78 devtool : 'eval' ,
89 entry : [
910 'webpack-dev-server/client?http://localhost:3000' ,
@@ -19,11 +20,21 @@ module.exports = {
1920 new webpack . HotModuleReplacementPlugin ( )
2021 ] ,
2122 module : {
22- loaders : [ {
23- test : / \. j s $ / ,
24- loaders : [ 'react-hot-loader' , 'babel-loader' ] ,
25- include : path . join ( __dirname , 'src' )
26- } ]
23+ rules : [
24+ {
25+ test : / \. j s $ / ,
26+ include : path . join ( __dirname , 'src' ) ,
27+ use : [
28+ {
29+ loader : 'babel-loader' ,
30+ options : {
31+ presets : [ '@babel/preset-env' , '@babel/preset-react' ] ,
32+ plugins : [ 'react-hot-loader/babel' ]
33+ }
34+ }
35+ ]
36+ }
37+ ]
2738 } ,
2839 node : {
2940 fs : 'empty' ,
You can’t perform that action at this time.
0 commit comments