Switched from snowpack to vite

This commit is contained in:
Dmitriy Shishkov 2021-10-11 13:52:38 +03:00
parent c3ae023ff7
commit 60724dfa60
No known key found for this signature in database
GPG Key ID: 14358F96FCDD8060
7 changed files with 32 additions and 54 deletions

3
.gitignore vendored
View File

@ -1,3 +1,4 @@
node_modules/
package-lock.json
build/
pnpm-lock.yaml
dist/

13
index.html Normal file
View File

@ -0,0 +1,13 @@
<!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="./src/index.tsx"></script>
</body>
</html>

View File

@ -1,20 +1,21 @@
{
"scripts": {
"dev": "snowpack dev",
"build": "snowpack build",
"dev": "vite",
"build": "vite 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"
"serve": "^12.0.0",
"typescript": "^4.4.2",
"vite": "^2.5.3",
"@emotion/react": "^11.4.1",
"@emotion/styled": "^11.3.0"
},
"dependencies": {
"@mui/icons-material": "^5.0.3",
"@mui/material": "^5.0.3",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
},
"private": "true"
}

View File

@ -1,15 +0,0 @@
<!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>

View File

@ -1,25 +0,0 @@
// 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.*"],
};

View File

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

3
vite.config.js Normal file
View File

@ -0,0 +1,3 @@
import { defineConfig } from "vite";
export default defineConfig({});