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

Commit 74bfe36

Browse files
sophiiistikacafca
authored andcommitted
Fix jsx setup
1 parent 6ce1bb2 commit 74bfe36

3 files changed

Lines changed: 21 additions & 21 deletions

File tree

src/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React from "react";
22

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

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"));

webpack.config.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
const path = require('path');
1+
const path = require("path");
22

3-
const HtmlWebpackPlugin = require('html-webpack-plugin');
3+
const HtmlWebpackPlugin = require("html-webpack-plugin");
44

55
const getPath = (file) => {
6-
return path.resolve(__dirname, 'src', file);
6+
return path.resolve(__dirname, "src", file);
77
};
88

99
module.exports = (env, argv) => {
10-
const isDevelopment = argv.mode === 'development';
11-
const filename = isDevelopment ? '[name]' : '[name]-[contenthash:6]';
10+
const isDevelopment = argv.mode === "development";
11+
const filename = isDevelopment ? "[name]" : "[name]-[contenthash:6]";
1212

1313
return {
1414
entry: {
15-
app: getPath('index.tsx'),
15+
app: getPath("index.tsx"),
1616
},
1717
output: {
1818
filename: `${filename}.js`,
1919
sourceMapFilename: `${filename}.js.map`,
2020
},
2121
resolve: {
2222
alias: {
23-
'~': path.resolve(__dirname, 'src'),
23+
"~": path.resolve(__dirname, "src"),
2424
},
25-
extensions: ['.js', '.ts', '.tsx'],
25+
extensions: [".js", ".ts", ".tsx"],
2626
},
2727
module: {
2828
rules: [
@@ -31,25 +31,25 @@ module.exports = (env, argv) => {
3131
exclude: /node_modules/,
3232
use: [
3333
{
34-
loader: 'babel-loader',
34+
loader: "babel-loader",
3535
},
3636
{
37-
loader: 'eslint-loader',
37+
loader: "eslint-loader",
3838
},
3939
{
40-
loader: 'ts-loader',
40+
loader: "ts-loader",
4141
},
4242
],
4343
},
4444
],
4545
},
4646
plugins: [
4747
new HtmlWebpackPlugin({
48-
filename: 'index.html',
49-
template: getPath('index.html'),
48+
filename: "index.html",
49+
template: getPath("index.html"),
5050
}),
5151
],
52-
devtool: 'source-map',
52+
devtool: "source-map",
5353
devServer: {
5454
port: 4000,
5555
},

0 commit comments

Comments
 (0)