initial commit

This commit is contained in:
Niklas 2020-04-19 23:31:59 +02:00
commit f37e5d1fd0
10 changed files with 9363 additions and 0 deletions

21
.eslintrc.json Normal file
View File

@ -0,0 +1,21 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"react"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended"
],
"rules": {
"semi": "error"
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
}
}

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/node_modules
/dist

9198
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

34
package.json Normal file
View File

@ -0,0 +1,34 @@
{
"name": "startpage",
"version": "1.0.0",
"description": "",
"main": "src/index.ts",
"scripts": {
"devServer": "webpack-dev-server --mode development --inline --hot --open",
"build": "webpack --mode development"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@types/react": "^16.9.34",
"@types/react-dom": "^16.9.6",
"@typescript-eslint/eslint-plugin": "^2.28.0",
"@typescript-eslint/parser": "^2.28.0",
"css-loader": "^3.5.2",
"eslint": "^6.8.0",
"eslint-plugin-react": "^7.19.0",
"html-webpack-plugin": "^4.2.0",
"mini-css-extract-plugin": "^0.9.0",
"node-sass": "^4.13.1",
"sass-loader": "^8.0.2",
"ts-loader": "^7.0.0",
"typescript": "^3.8.3",
"webpack": "^4.42.1",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3"
},
"dependencies": {
"react": "^16.13.1",
"react-dom": "^16.13.1"
}
}

14
src/components/app.tsx Normal file
View File

@ -0,0 +1,14 @@
import * as React from "react";
class App extends React.Component {
constructor(props) {
super(props);
}
render(): JSX.Element {
return <h1>Hello world</h1>;
}
}
export default App;

10
src/index.html Normal file
View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<div id="root"></div>
</body>
</html>

12
src/index.tsx Normal file
View File

@ -0,0 +1,12 @@
import * as React from "react";
import * as ReactDOM from "react-dom";
import App from "./components/app";
import "./style/default.scss";
ReactDOM.render(
<App/>,
document.getElementById("root")
);

3
src/style/default.scss Normal file
View File

@ -0,0 +1,3 @@
body {
background-color: darkgray;
}

13
tsconfig.json Normal file
View File

@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "es5",
"module": "es6",
"moduleResolution": "node",
"sourceMap": true,
"noLib": false,
"jsx": "react",
},
"exclude": [
"node_modules"
]
}

56
webpack.config.js Normal file
View File

@ -0,0 +1,56 @@
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const webpack = require("webpack");
const path = require("path");
module.exports = {
context: path.join(__dirname, "src"),
resolve: {
extensions: [".js", ".ts", ".tsx"]
},
entry: ["./index.tsx"],
output: {
path: path.join(__dirname, "dist"),
filename: "bundle.js"
},
devtool: "source-map",
devServer: {
contentBase: "./dist", // Content base
inline: true, // Enable watch and live reload
host: "localhost",
port: 8080,
stats: "errors-only"
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
exclude: /node_modules/,
loader: "ts-loader"
},
{
test: /\.s[ac]ss$/i,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
"sass-loader",
],
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: "file-loader",
options: {
name: "assets/img/[name].[ext]?[hash]"
}
}
]
},
plugins: [
new HtmlWebpackPlugin({
filename: "index.html",
template: "index.html",
hash: true
}),
new MiniCssExtractPlugin()
]
};