This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree 5 files changed +35
-27
lines changed
5 files changed +35
-27
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 9
9
"license" : " MIT" ,
10
10
"keywords" : [],
11
11
"devDependencies" : {
12
- "babel-core" : " ^5.4.7" ,
13
- "babel-loader" : " ^5.1.2" ,
12
+ "@babel/core" : " ^7.2.2" ,
13
+ "@babel/preset-env" : " ^7.3.1" ,
14
+ "@babel/preset-react" : " ^7.0.0" ,
15
+ "babel-loader" : " ^8.0.5" ,
14
16
"ipfs-http-client" : " ../../" ,
15
- "json-loader" : " ~0.5.3" ,
16
- "react" : " ~0.13.0" ,
17
- "react-hot-loader" : " ^1.3.0" ,
18
- "webpack" : " ^1.9.6" ,
19
- "webpack-dev-server" : " ^1.8.2"
20
- }
17
+ "react" : " ^16.8.1" ,
18
+ "react-dom" : " ^16.8.1" ,
19
+ "react-hot-loader" : " ^4.6.5" ,
20
+ "webpack" : " ^4.29.3" ,
21
+ "webpack-dev-server" : " ^3.1.14"
22
+ },
23
+ "browserslist" : [
24
+ " >1%" ,
25
+ " not dead" ,
26
+ " not ie <= 11" ,
27
+ " not op_mini all"
28
+ ]
21
29
}
Original file line number Diff line number Diff line change @@ -29,15 +29,9 @@ class App extends React.Component {
29
29
if ( err ) throw err
30
30
const hash = res [ 0 ] . hash
31
31
this . setState ( { added_file_hash : hash } )
32
- ipfs . cat ( hash , ( err , res ) => {
32
+ ipfs . cat ( hash , ( err , data ) => {
33
33
if ( err ) throw err
34
- let data = ''
35
- res . on ( 'data' , ( d ) => {
36
- data = data + d
37
- } )
38
- res . on ( 'end' , ( ) => {
39
- this . setState ( { added_file_contents : data } )
40
- } )
34
+ this . setState ( { added_file_contents : data . toString ( ) } )
41
35
} )
42
36
} )
43
37
}
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
const React = require ( 'react' )
3
+ const ReactDOM = require ( 'react-dom' )
3
4
const App = require ( './App' )
4
5
5
- React . render ( < App /> , document . getElementById ( 'root' ) )
6
+ ReactDOM . render ( < App /> , document . getElementById ( 'root' ) )
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
- var path = require ( 'path' )
4
- var webpack = require ( 'webpack' )
3
+ const path = require ( 'path' )
4
+ const webpack = require ( 'webpack' )
5
5
6
6
module . exports = {
7
+ mode : 'production' ,
7
8
devtool : 'eval' ,
8
9
entry : [
9
10
'webpack-dev-server/client?http://localhost:3000' ,
@@ -19,11 +20,18 @@ module.exports = {
19
20
new webpack . HotModuleReplacementPlugin ( )
20
21
] ,
21
22
module : {
22
- loaders : [ {
23
- test : / \. j s $ / ,
24
- loaders : [ 'react-hot' , 'babel' ] ,
25
- include : path . join ( __dirname , 'src' )
26
- } , { test : / \. j s o n $ / , loader : 'json-loader' } ]
23
+ rules : [
24
+ {
25
+ test : / \. j s $ / ,
26
+ exclude : / n o d e _ m o d u l e s / ,
27
+ use : {
28
+ loader : 'babel-loader' ,
29
+ options : {
30
+ presets : [ '@babel/preset-env' , '@babel/preset-react' ]
31
+ }
32
+ }
33
+ }
34
+ ]
27
35
} ,
28
36
node : {
29
37
fs : 'empty' ,
You can’t perform that action at this time.
0 commit comments