From 60724dfa60e038a1a80ea66291f9ba2187d39b70 Mon Sep 17 00:00:00 2001 From: dm1sh Date: Mon, 11 Oct 2021 13:52:38 +0300 Subject: [PATCH] Switched from snowpack to vite --- .gitignore | 3 ++- index.html | 13 +++++++++++++ package.json | 21 +++++++++++---------- public/index.html | 15 --------------- snowpack.config.js | 25 ------------------------- tsconfig.json | 6 +++--- vite.config.js | 3 +++ 7 files changed, 32 insertions(+), 54 deletions(-) create mode 100644 index.html delete mode 100644 public/index.html delete mode 100644 snowpack.config.js create mode 100644 vite.config.js diff --git a/.gitignore b/.gitignore index 7d245c9..4e8a7b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules/ package-lock.json -build/ \ No newline at end of file +pnpm-lock.yaml +dist/ \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..3c916f2 --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + React application + + + +
+ + + diff --git a/package.json b/package.json index 8e8f93f..a2a3ca7 100644 --- a/package.json +++ b/package.json @@ -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" } diff --git a/public/index.html b/public/index.html deleted file mode 100644 index db5f1ff..0000000 --- a/public/index.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - React application - - - -
- - - - \ No newline at end of file diff --git a/snowpack.config.js b/snowpack.config.js deleted file mode 100644 index 2cba93b..0000000 --- a/snowpack.config.js +++ /dev/null @@ -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.*"], -}; diff --git a/tsconfig.json b/tsconfig.json index 7264e4b..f7ea917 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -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" } } diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..6150f9a --- /dev/null +++ b/vite.config.js @@ -0,0 +1,3 @@ +import { defineConfig } from "vite"; + +export default defineConfig({});