File tree Expand file tree Collapse file tree 8 files changed +5399
-2
lines changed Expand file tree Collapse file tree 8 files changed +5399
-2
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "presets" : [" @babel/preset-env" , " @babel/preset-react" ]
3
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "parser": "babel-eslint",
3
+ "extends": "react",
4
+ "env": {
5
+ "browser": true,
6
+ "node": true
7
+ },
8
+ "settings": {
9
+ "react": {
10
+ "version": "detect"
11
+ }
12
+ },
13
+ "rules": {
14
+ "indent": ["error", 2],
15
+ "space-before-function-paren": ["off"]
16
+ }
17
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "semi": true,
3
+ "singleQuote": true,
4
+ "trailingComma": "es5",
5
+ "bracketSpacing": true
6
+ }
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ < title > My React Configuration Setup</ title >
5
+ </ head >
6
+ < body >
7
+ < div id ="root "> </ div >
8
+ < script src ="./dist/bundle.js "> </ script >
9
+ </ body >
10
+ </ html >
Original file line number Diff line number Diff line change 6
6
"react" : " ^16.7.0" ,
7
7
"react-dom" : " ^16.7.0"
8
8
},
9
- "scripts" : {},
10
- "devDependencies" : {}
9
+ "scripts" : {
10
+ "start" : " webpack-dev-server --mode development" ,
11
+ "format" : " prettier --write \" src/**/*.js\" " ,
12
+ "build" : " webpack --mode production"
13
+ },
14
+ "devDependencies" : {
15
+ "@babel/core" : " ^7.2.2" ,
16
+ "@babel/preset-env" : " ^7.3.1" ,
17
+ "@babel/preset-react" : " ^7.0.0" ,
18
+ "babel-eslint" : " ^10.0.1" ,
19
+ "babel-loader" : " ^8.0.5" ,
20
+ "eslint" : " ^5.12.1" ,
21
+ "eslint-config-react" : " ^1.1.7" ,
22
+ "eslint-loader" : " ^2.1.1" ,
23
+ "eslint-plugin-react" : " ^7.12.4" ,
24
+ "prettier" : " 1.16.2" ,
25
+ "webpack" : " ^4.29.0" ,
26
+ "webpack-cli" : " ^3.2.1" ,
27
+ "webpack-dev-server" : " ^3.1.14"
28
+ }
11
29
}
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import ReactDOM from 'react-dom' ;
3
+
4
+ class Welcome extends React . Component {
5
+ render ( ) {
6
+ return < h1 > Hello World</ h1 > ;
7
+ }
8
+ }
9
+
10
+ ReactDOM . render ( < Welcome /> , document . getElementById ( 'root' ) ) ;
Original file line number Diff line number Diff line change
1
+ const path = require ( 'path' ) ;
2
+
3
+ module . exports = {
4
+ devtool : 'inline-source-map' ,
5
+ entry : './src/index.js' ,
6
+ output : {
7
+ path : path . join ( __dirname , '/dist' ) ,
8
+ publicPath : '/' ,
9
+ filename : 'bundle.js'
10
+ } ,
11
+ devServer : {
12
+ contentBase : './' ,
13
+ publicPath : '/dist/'
14
+ } ,
15
+ module : {
16
+ rules : [
17
+ {
18
+ test : / \. ( j s | j s x ) $ / ,
19
+ exclude : / n o d e _ m o d u l e s / ,
20
+ use : [ 'babel-loader' , 'eslint-loader' ]
21
+ }
22
+ ]
23
+ }
24
+ } ;
You can’t perform that action at this time.
0 commit comments