Initial commit

This commit is contained in:
Dmitriy Shishkov 2021-10-11 12:29:15 +05:00
commit c3ae023ff7
10 changed files with 140 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
node_modules/
package-lock.json
build/

17
README.md Normal file
View File

@ -0,0 +1,17 @@
# \<Project name\>
<p align="center">
<img src="https://github.com/<Organization name>/<Repo name>/raw/main/logo.svg" alt="<Logo description>" width="150px">
</p>
## Overview
\<Example text\>
## Deploy
\<Deployment instruction\>
```bash
<Code>
```

20
package.json Normal file
View File

@ -0,0 +1,20 @@
{
"scripts": {
"dev": "snowpack dev",
"build": "snowpack build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"@snowpack/plugin-typescript": "^1.2.1",
"@types/node": "^15.0.1",
"@types/react": "^17.0.4",
"@types/react-dom": "^17.0.3",
"@types/snowpack-env": "^2.3.3",
"snowpack": "^3.3.5",
"typescript": "^4.2.4"
},
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
}

15
public/index.html Normal file
View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>React application</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/dist/index.js"></script>
</body>
</html>

2
public/robots.txt Normal file
View File

@ -0,0 +1,2 @@
User-agent: *
Allow: /

25
snowpack.config.js Normal file
View File

@ -0,0 +1,25 @@
// Snowpack Configuration File
// See all supported options: https://www.snowpack.dev/reference/configuration
/** @type {import("snowpack").SnowpackUserConfig } */
module.exports = {
plugins: ["@snowpack/plugin-typescript"],
packageOptions: {
polyfillNode: true,
},
mount: {
public: "/",
src: "/dist",
},
optimize: {
bundle: true,
},
routes: [
{ match: "routes", src: "robots.txt", dest: "/robots.txt" },
{ match: "routes", src: ".*", dest: "/index.html" },
],
devOptions: {
open: "none",
},
exclude: ["**/node_modules/**/*", "**/*.test.*"],
};

3
src/App.tsx Normal file
View File

@ -0,0 +1,3 @@
import React from "react";
export const App = () => <div>Hello, world</div>;

25
src/index.css Normal file
View File

@ -0,0 +1,25 @@
* {
margin: 0;
padding: 0;
-ms-overflow-style: none;
scrollbar-width: none;
box-sizing: border-box;
outline: none;
}
*::-webkit-scrollbar {
display: none;
}
body {
font-family: Inter, system-ui, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background: rgba(54, 54, 69, 0.05) none repeat scroll 0% 0%;
color: rgb(54, 54, 69);
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}

17
src/index.tsx Normal file
View File

@ -0,0 +1,17 @@
import React from "react";
import ReactDOM from "react-dom";
import './index.css'
import { App } from "./App";
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById("root")
);
if (import.meta.hot) {
import.meta.hot.accept();
}

13
tsconfig.json Normal file
View File

@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "es5",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react-jsx",
"lib": ["DOM"],
"module": "ES2020",
"moduleResolution": "node"
}
}