From f169dafa9a59fc21526f260cfae292279d55a3c0 Mon Sep 17 00:00:00 2001 From: Dreamacro <8615343+Dreamacro@users.noreply.github.com> Date: Sat, 2 Oct 2021 00:14:56 +0800 Subject: [PATCH] Fix: esbuild inject --- src/components/ButtonSelect/index.tsx | 1 - src/components/Checkbox/index.tsx | 1 - src/components/Header/index.tsx | 1 - src/components/Icon/index.tsx | 1 - src/components/Input/index.tsx | 1 - src/components/Loading/Spinner/index.tsx | 1 - src/components/Switch/index.tsx | 1 - src/components/Tag/index.tsx | 1 - src/containers/Overview/index.tsx | 2 -- src/containers/Rules/Provider/index.tsx | 1 - src/containers/Sidebar/index.tsx | 1 - vite.config.ts | 3 +++ 12 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/components/ButtonSelect/index.tsx b/src/components/ButtonSelect/index.tsx index df6949c..66710e9 100644 --- a/src/components/ButtonSelect/index.tsx +++ b/src/components/ButtonSelect/index.tsx @@ -1,5 +1,4 @@ import classnames from 'classnames' -import * as React from 'react' import { BaseComponentProps } from '@models/BaseProps' import './style.scss' diff --git a/src/components/Checkbox/index.tsx b/src/components/Checkbox/index.tsx index 8af8181..5eccb3c 100644 --- a/src/components/Checkbox/index.tsx +++ b/src/components/Checkbox/index.tsx @@ -1,5 +1,4 @@ import classnames from 'classnames' -import * as React from 'react' import { Icon } from '@components' import { noop } from '@lib/helper' diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index 57ebaae..985a0dd 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -1,5 +1,4 @@ import classnames from 'classnames' -import * as React from 'react' import { BaseComponentProps } from '@models/BaseProps' import './style.scss' diff --git a/src/components/Icon/index.tsx b/src/components/Icon/index.tsx index 84f9529..efad363 100644 --- a/src/components/Icon/index.tsx +++ b/src/components/Icon/index.tsx @@ -1,5 +1,4 @@ import classnames from 'classnames' -import * as React from 'react' import { BaseComponentProps } from '@models/BaseProps' diff --git a/src/components/Input/index.tsx b/src/components/Input/index.tsx index fd440e9..4162279 100644 --- a/src/components/Input/index.tsx +++ b/src/components/Input/index.tsx @@ -1,5 +1,4 @@ import classnames from 'classnames' -import * as React from 'react' import { noop } from '@lib/helper' import { BaseComponentProps } from '@models/BaseProps' diff --git a/src/components/Loading/Spinner/index.tsx b/src/components/Loading/Spinner/index.tsx index dbb2912..0b0ca74 100644 --- a/src/components/Loading/Spinner/index.tsx +++ b/src/components/Loading/Spinner/index.tsx @@ -1,5 +1,4 @@ import classnames from 'classnames' -import * as React from 'react' import { BaseComponentProps } from '@models/BaseProps' diff --git a/src/components/Switch/index.tsx b/src/components/Switch/index.tsx index 4f2ae40..5532c0d 100644 --- a/src/components/Switch/index.tsx +++ b/src/components/Switch/index.tsx @@ -1,5 +1,4 @@ import classnames from 'classnames' -import * as React from 'react' import { Icon } from '@components' import { noop } from '@lib/helper' diff --git a/src/components/Tag/index.tsx b/src/components/Tag/index.tsx index fcf7b71..7f1c788 100644 --- a/src/components/Tag/index.tsx +++ b/src/components/Tag/index.tsx @@ -1,5 +1,4 @@ import classnames from 'classnames' -import * as React from 'react' import { BaseComponentProps } from '@models/BaseProps' diff --git a/src/containers/Overview/index.tsx b/src/containers/Overview/index.tsx index fe90538..d0e1f7f 100644 --- a/src/containers/Overview/index.tsx +++ b/src/containers/Overview/index.tsx @@ -1,5 +1,3 @@ -import * as React from 'react' - import logo from '@assets/logo-fixing.svg' export default function Overview () { diff --git a/src/containers/Rules/Provider/index.tsx b/src/containers/Rules/Provider/index.tsx index ece2305..eb2c6c6 100644 --- a/src/containers/Rules/Provider/index.tsx +++ b/src/containers/Rules/Provider/index.tsx @@ -1,5 +1,4 @@ import classnames from 'classnames' -import * as React from 'react' import { Tag, Icon } from '@components' import { fromNow } from '@lib/date' diff --git a/src/containers/Sidebar/index.tsx b/src/containers/Sidebar/index.tsx index a297099..b1e1d29 100644 --- a/src/containers/Sidebar/index.tsx +++ b/src/containers/Sidebar/index.tsx @@ -1,5 +1,4 @@ import classnames from 'classnames' -import * as React from 'react' import { NavLink } from 'react-router-dom' import logo from '@assets/logo.png' diff --git a/vite.config.ts b/vite.config.ts index a7a7718..1342802 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -34,5 +34,8 @@ export default defineConfig( }, }, build: { reportCompressedSize: false }, + esbuild: { + jsxInject: "import React from 'react'", + }, }), )