-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hector Rodrigues da Silva
committed
Nov 29, 2022
1 parent
d9eed87
commit f5738b0
Showing
8 changed files
with
5,971 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
presets: [ | ||
"@babel/preset-env", | ||
"@babel/preset-typescript", | ||
["@babel/preset-react", { runtime: "automatic" }] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
export const App = (): JSX.Element => { | ||
return ( | ||
<div>Hello</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" | ||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<link rel="stylesheet" type="text/css" href="styles.css"> | ||
<title>React Block Duck</title> | ||
</head> | ||
<body> | ||
<noscript>Not support this javascript</noscript> | ||
<div id="root"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react' | ||
import {createRoot} from 'react-dom/client' | ||
import {App} from './App'; | ||
|
||
const root = createRoot(document.getElementById('root')); | ||
|
||
root.render( | ||
<React.StrictMode> | ||
<App/> | ||
</React.StrictMode> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"compilerOptions": { | ||
"outDir": "./dist/", | ||
"noImplicitAny": true, | ||
"module": "es6", | ||
"target": "es5", | ||
"jsx": "react-jsx", | ||
"allowJs": true, | ||
"moduleResolution": "node", | ||
"allowSyntheticDefaultImports": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
const path = require('path'); | ||
const ProvidePlugin = require('webpack/lib/ProvidePlugin'); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
const {CleanWebpackPlugin} = require('clean-webpack-plugin'); | ||
|
||
module.exports = { | ||
mode: "development", | ||
devtool: 'source-map', | ||
entry: { | ||
table: path.resolve(__dirname, "public") | ||
}, | ||
output: { | ||
clean: true, | ||
path: path.resolve(__dirname, "build"), | ||
filename: "bundle.js", | ||
}, | ||
devServer: { | ||
port: 3000, | ||
hot: true, | ||
open: true, | ||
allowedHosts: 'all', | ||
}, | ||
resolve: { | ||
extensions: [".js", ".jsx", ".ts", ".tsx"] | ||
}, | ||
plugins: [ | ||
new ProvidePlugin({ | ||
React: 'react' | ||
}), | ||
new CleanWebpackPlugin(), | ||
new HtmlWebpackPlugin({ | ||
inject: true, | ||
template: path.join(__dirname, "public", "index.html") | ||
}) | ||
], | ||
module: { | ||
rules: [ | ||
{ | ||
test: /.(ts|js)[x]?$/i, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: "babel-loader" | ||
} | ||
}, | ||
{ | ||
test: /.css$/i, | ||
use: [ | ||
{loader: "style-loader"}, | ||
{loader: "css-loader"}, | ||
] | ||
}, | ||
] | ||
} | ||
} |
Oops, something went wrong.