This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +35
-27
lines changed
Expand file tree Collapse file tree 5 files changed +35
-27
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 99 "license" : " MIT" ,
1010 "keywords" : [],
1111 "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" ,
1416 "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+ ]
2129}
Original file line number Diff line number Diff line change @@ -29,15 +29,9 @@ class App extends React.Component {
2929 if ( err ) throw err
3030 const hash = res [ 0 ] . hash
3131 this . setState ( { added_file_hash : hash } )
32- ipfs . cat ( hash , ( err , res ) => {
32+ ipfs . cat ( hash , ( err , data ) => {
3333 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 ( ) } )
4135 } )
4236 } )
4337 }
Original file line number Diff line number Diff line change 11'use strict'
22const React = require ( 'react' )
3+ const ReactDOM = require ( 'react-dom' )
34const App = require ( './App' )
45
5- React . render ( < App /> , document . getElementById ( 'root' ) )
6+ ReactDOM . render ( < App /> , document . getElementById ( 'root' ) )
Original file line number Diff line number Diff line change 11'use strict'
22
3- var path = require ( 'path' )
4- var webpack = require ( 'webpack' )
3+ const path = require ( 'path' )
4+ const webpack = require ( 'webpack' )
55
66module . exports = {
7+ mode : 'production' ,
78 devtool : 'eval' ,
89 entry : [
910 'webpack-dev-server/client?http://localhost:3000' ,
@@ -19,11 +20,18 @@ module.exports = {
1920 new webpack . HotModuleReplacementPlugin ( )
2021 ] ,
2122 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+ ]
2735 } ,
2836 node : {
2937 fs : 'empty' ,
You can’t perform that action at this time.
0 commit comments