diff --git a/package.json b/package.json index 6fd58da..9a5c71c 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "version": "2.0.7", "license": "MIT", "type": "module", + "sideEffects": false, "scripts": { "dev": "vite", "build": "tsc && vite build", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d11ca84..f749a83 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -53,7 +53,7 @@ dependencies: devDependencies: '@crxjs/vite-plugin': - specifier: 2.0.0-beta.26 + specifier: ^2.0.0-beta.26 version: 2.0.0-beta.26 '@thedutchcoder/postcss-rem-to-px': specifier: ^0.0.2 diff --git a/src/content/components/MainModal.tsx b/src/content/components/MainModal.tsx index 231c824..9b9f2b3 100644 --- a/src/content/components/MainModal.tsx +++ b/src/content/components/MainModal.tsx @@ -1,5 +1,5 @@ import { motion } from 'framer-motion' -import { useState } from 'react' +import { useState, useMemo } from 'react' import { BottomNavigation } from './BottomNavigation' import { SettingsContent } from './setting' @@ -28,16 +28,21 @@ const modalVariants: Variants = { export function MainModal() { const [activeTab, setActiveTab] = useState<'tasks' | 'settings'>('tasks') + const Content = useMemo(() => { + return activeTab === 'tasks' ? : + }, [activeTab]) + return (
- {activeTab === 'tasks' ? : } + {Content}
diff --git a/vite.config.ts b/vite.config.ts index d3f88ac..1ac4e2a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import { crx } from '@crxjs/vite-plugin' import react from '@vitejs/plugin-react' import { resolve } from 'path' @@ -25,15 +24,4 @@ export default defineConfig({ '@/assets': resolve(__dirname, './src/assets'), }, }, - build: { - chunkSizeWarningLimit: 1024, - rollupOptions: { - onwarn(warning, warn) { - if (warning.code === 'MODULE_LEVEL_DIRECTIVE') { - return - } - warn(warning) - }, - }, - }, })