Skip to content
This repository was archived by the owner on Dec 25, 2025. It is now read-only.

Commit eb3b663

Browse files
committed
Fix jsx setup
1 parent 1431899 commit eb3b663

5 files changed

Lines changed: 26 additions & 26 deletions

File tree

babel.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
}
99
],
1010
"@babel/typescript",
11-
"@babel/preset-react"
11+
"@babel/react"
1212
]
1313
}

src/app.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from 'react';
1+
import React from "react";
22

3-
const App = () => <p>Hallo</p>;
3+
const App = () => <p>Hallo, hier ist alles schön :)</p>;
44

5-
export default App;
5+
export default App;

src/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import 'core-js/stable';
2-
import 'regenerator-runtime/runtime';
1+
import "core-js/stable";
2+
import "regenerator-runtime/runtime";
33

4-
import React from 'react';
5-
import ReactDOM from 'react-dom';
6-
import App from './app'
4+
import React from "react";
5+
import ReactDOM from "react-dom";
6+
import App from "./app";
77

8-
ReactDOM.render(<App />, document.getElementById('root'));
8+
ReactDOM.render(<App />, document.getElementById("root"));

tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"compilerOptions": {
3+
"jsx": "react"
4+
},
25
"compiler": {
36
"jsx": "react",
47
"noImplicitAny": false,

webpack.config.js

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");
22
const path = require("path");
33

44
module.exports = {
5-
mode: 'development',
6-
target: 'web',
7-
devtool: 'eval-source-map',
8-
entry: './src/index.tsx',
5+
mode: "development",
6+
target: "web",
7+
devtool: "eval-source-map",
8+
entry: "./src/index.tsx",
99
resolve: {
10-
extensions: ['.ts', '.tsx']
10+
extensions: [".js", ".ts", ".tsx"],
1111
},
1212
module: {
1313
rules: [
@@ -16,19 +16,16 @@ module.exports = {
1616
exclude: /node_modules/,
1717
use: [
1818
{
19-
loader: 'babel-loader'
19+
loader: "babel-loader",
2020
},
21-
{
22-
loader: 'ts-loader'
23-
},
24-
]
25-
}
26-
]
21+
],
22+
},
23+
],
2724
},
2825
plugins: [
2926
new HtmlWebpackPlugin({
30-
filename: 'index.html',
31-
template: path.resolve(__dirname, 'src', 'index.html')
32-
})
33-
]
27+
filename: "index.html",
28+
template: path.resolve(__dirname, "src", "index.html"),
29+
}),
30+
],
3431
};

0 commit comments

Comments
 (0)