This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree 3 files changed +29
-18
lines changed
examples/upload-file-via-browser 3 files changed +29
-18
lines changed Original file line number Diff line number Diff line change 11
11
],
12
12
"license" : " MIT" ,
13
13
"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 " ,
16
16
"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 "
23
23
}
24
24
}
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class App extends React.Component {
23
23
event . stopPropagation ( )
24
24
event . preventDefault ( )
25
25
const file = event . target . files [ 0 ]
26
- if ( document . getElementById ( " keepFilename" ) . checked ) {
26
+ if ( document . getElementById ( ' keepFilename' ) . checked ) {
27
27
this . saveToIpfsWithFilename ( file )
28
28
} else {
29
29
this . saveToIpfs ( file )
@@ -63,7 +63,7 @@ class App extends React.Component {
63
63
. then ( ( response ) => {
64
64
console . log ( response )
65
65
// CID of wrapping directory is returned last
66
- ipfsId = response [ response . length - 1 ] . hash
66
+ ipfsId = response [ response . length - 1 ] . hash
67
67
console . log ( ipfsId )
68
68
this . setState ( { added_file_hash : ipfsId } )
69
69
} ) . catch ( ( err ) => {
@@ -80,7 +80,7 @@ class App extends React.Component {
80
80
< div >
81
81
< form id = 'captureMedia' onSubmit = { this . handleSubmit } >
82
82
< 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 >
84
84
</ form >
85
85
< div >
86
86
< a target = '_blank'
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
- let path = require ( 'path' )
4
- let webpack = require ( 'webpack' )
3
+ const path = require ( 'path' )
4
+ const webpack = require ( 'webpack' )
5
5
6
6
module . exports = {
7
+ mode : 'development' ,
7
8
devtool : 'eval' ,
8
9
entry : [
9
10
'webpack-dev-server/client?http://localhost:3000' ,
@@ -19,11 +20,21 @@ module.exports = {
19
20
new webpack . HotModuleReplacementPlugin ( )
20
21
] ,
21
22
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
+ ]
27
38
} ,
28
39
node : {
29
40
fs : 'empty' ,
You can’t perform that action at this time.
0 commit comments