From 862aefa2e910193e8b573c3c95aaabf408620888 Mon Sep 17 00:00:00 2001 From: Mostafa Rahmati Date: Mon, 15 Aug 2022 14:11:37 +0430 Subject: [PATCH 1/2] chore: fix vite.config for v3 --- vite.config.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index ddf6575..6da8230 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -16,7 +16,7 @@ const shouldAnalyze = process.env.ANALYZE ?? false; const isHttps = process.env.HTTPS ?? false; // https://vitejs.dev/config/ -export default defineConfig((mode) => { +export default defineConfig((config: ConfigEnv) => { return { plugins: [ react({ @@ -40,13 +40,12 @@ export default defineConfig((mode) => { Unocss(), viteImagemin({ - disable: mode === 'development', + disable: config.mode === 'development', mozjpeg: { progressive: true, quality: 80, }, optipng: { - enabled: true, optimizationLevel: 3, }, pngquant: { From 172986ef3532a7d5a5676c364b76c36707d28413 Mon Sep 17 00:00:00 2001 From: Mostafa Rahmati Date: Mon, 15 Aug 2022 14:12:27 +0430 Subject: [PATCH 2/2] chore: change yarn ro npm --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 2681216..d289bb4 100644 --- a/package.json +++ b/package.json @@ -45,12 +45,12 @@ "reset:git": "rimraf .git && git init && git add . && git commit -m \"init commit\"", "reset:vite": "rimraf ./.vite-cache ./dist", "reset:file": "node ./clean.js", - "reset": "yarn run reset:vite && yarn run reset:file && yarn run reset:git", - "dev": "yarn run reset:vite && cross-env DEBUG=vite:plugin:mkcert HTTPS=true vite", - "dev:http": "yarn run reset:vite && vite", - "build": "yarn run reset:vite && tsc && vite build", - "preview": "yarn run build && vite preview", - "analyze": "yarn run reset:vite && cross-env ANALYZE=true yarn run build", + "reset": "npm run reset:vite && npm run reset:file && npm run reset:git", + "dev": "npm run reset:vite && cross-env DEBUG=vite:plugin:mkcert HTTPS=true vite", + "dev:http": "npm run reset:vite && vite", + "build": "npm run reset:vite && tsc && vite build", + "preview": "npm run build && vite preview", + "analyze": "npm run reset:vite && cross-env ANALYZE=true npm run build", "mock:server": "json-server --watch ./mock/index.json --config ./mock/config.json", "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook"