File tree Expand file tree Collapse file tree 4 files changed +20
-12
lines changed Expand file tree Collapse file tree 4 files changed +20
-12
lines changed Original file line number Diff line number Diff line change 33 "demo" : " webpack-dev-server --open"
44 },
55 "dependencies" : {
6- "react" : " 16.9.0" ,
7- "react-dom" : " 16.9.0"
6+ "react" : " 17.0.1" ,
7+ "react-dom" : " 17.0.1" ,
8+ "ts-node" : " 9.1.1"
89 },
910 "devDependencies" : {
11+ "@types/html-webpack-plugin" : " 3.2.4" ,
1012 "@types/node" : " 12.7.2" ,
1113 "@types/react" : " 16.9.2" ,
1214 "@types/react-dom" : " 16.9.0" ,
15+ "@types/webpack" : " 4.41.25" ,
1316 "css-loader" : " 3.2.0" ,
1417 "html-webpack-plugin" : " 3.2.0" ,
1518 "source-map-loader" : " 0.2.4" ,
19+ "strip-ansi" : " 6.0.0" ,
1620 "style-loader" : " 1.0.0" ,
1721 "ts-loader" : " 6.0.4" ,
1822 "typescript" : " 3.8.3" ,
Original file line number Diff line number Diff line change 11import React from 'react'
22import ReactDOM from 'react-dom'
33
4- import Hello from './hello'
4+ import { Hello } from './hello'
55
66ReactDOM . render (
77 < Hello /> ,
Original file line number Diff line number Diff line change 1- //import * as React from 'react'
2- import React from 'react'
1+ import React , { FC } from 'react' ;
32
4- export default function Hello ( ) {
3+ type Props = { } ;
4+
5+ export const Hello : FC < Props > = ( { } ) => {
56 return < div >
67 < h1 > Hello React</ h1 >
7- </ div >
8- } ;
8+ </ div > ;
9+ }
Original file line number Diff line number Diff line change 1- const HtmlWebpackPlugin = require ( 'html-webpack-plugin' )
2- const path = require ( 'path' ) ;
1+ import { Configuration } from 'webpack' ;
2+ import HtmlWebpackPlugin from 'html-webpack-plugin' ;
3+ import path from 'path' ;
34
4- module . exports = {
5+ const config : Configuration = {
56 mode : 'development' ,
67 entry : './src/entry.tsx' ,
7- devtool : " inline-source-map" ,
8+ devtool : ' inline-source-map' ,
89 output : {
910 path : path . resolve ( __dirname , 'dist' ) ,
1011 filename : 'bundle.js'
@@ -23,3 +24,5 @@ module.exports = {
2324 new HtmlWebpackPlugin ( )
2425 ]
2526}
27+
28+ export default config ;
You can’t perform that action at this time.
0 commit comments