Switched from snowpack to vite
This commit is contained in:
parent
c3ae023ff7
commit
60724dfa60
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
package-lock.json
|
package-lock.json
|
||||||
build/
|
pnpm-lock.yaml
|
||||||
|
dist/
|
13
index.html
Normal file
13
index.html
Normal 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>
|
21
package.json
21
package.json
@ -1,20 +1,21 @@
|
|||||||
{
|
{
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "snowpack dev",
|
"dev": "vite",
|
||||||
"build": "snowpack build",
|
"build": "vite build",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@snowpack/plugin-typescript": "^1.2.1",
|
"serve": "^12.0.0",
|
||||||
"@types/node": "^15.0.1",
|
"typescript": "^4.4.2",
|
||||||
"@types/react": "^17.0.4",
|
"vite": "^2.5.3",
|
||||||
"@types/react-dom": "^17.0.3",
|
"@emotion/react": "^11.4.1",
|
||||||
"@types/snowpack-env": "^2.3.3",
|
"@emotion/styled": "^11.3.0"
|
||||||
"snowpack": "^3.3.5",
|
|
||||||
"typescript": "^4.2.4"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@mui/icons-material": "^5.0.3",
|
||||||
|
"@mui/material": "^5.0.3",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2"
|
"react-dom": "^17.0.2"
|
||||||
}
|
},
|
||||||
|
"private": "true"
|
||||||
}
|
}
|
||||||
|
@ -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>
|
|
@ -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.*"],
|
|
||||||
};
|
|
@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5",
|
"target": "ESNext",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"lib": ["DOM"],
|
"lib": ["es6", "DOM", "dom.iterable"],
|
||||||
"module": "ES2020",
|
"module": "ESNext",
|
||||||
"moduleResolution": "node"
|
"moduleResolution": "node"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
3
vite.config.js
Normal file
3
vite.config.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import { defineConfig } from "vite";
|
||||||
|
|
||||||
|
export default defineConfig({});
|
Loading…
x
Reference in New Issue
Block a user