mirror of
https://github.com/status-im/wakuconnect-chat-sdk.git
synced 2025-02-25 10:25:36 +00:00
use Vite in @status-im/components
This commit is contained in:
parent
05d4a54c14
commit
9d45202b8d
@ -5,15 +5,16 @@
|
|||||||
"*.css"
|
"*.css"
|
||||||
],
|
],
|
||||||
"private": true,
|
"private": true,
|
||||||
"types": "src/index.tsx",
|
"main": "./dist/index.js",
|
||||||
"main": "src/index.tsx",
|
"module": "./dist/index.mjs",
|
||||||
|
"types": "./dist/types/index.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
"types",
|
"types",
|
||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "tamagui-build --watch",
|
"dev": "TAMAGUI_TARGET='web' vite build --watch --mode development",
|
||||||
"build": "tamagui-build",
|
"build": "TAMAGUI_TARGET='web' vite build",
|
||||||
"postbuild": "yarn typegen",
|
"postbuild": "yarn typegen",
|
||||||
"typegen": "tsc --noEmit false --emitDeclarationOnly || true",
|
"typegen": "tsc --noEmit false --emitDeclarationOnly || true",
|
||||||
"lint": "eslint src",
|
"lint": "eslint src",
|
||||||
@ -50,8 +51,8 @@
|
|||||||
"@storybook/react": "7.0.0-beta.21",
|
"@storybook/react": "7.0.0-beta.21",
|
||||||
"@storybook/react-vite": "7.0.0-beta.21",
|
"@storybook/react-vite": "7.0.0-beta.21",
|
||||||
"@storybook/testing-library": "^0.0.13",
|
"@storybook/testing-library": "^0.0.13",
|
||||||
"@tamagui/build": "1.7.7",
|
|
||||||
"@tamagui/vite-plugin": "1.7.7",
|
"@tamagui/vite-plugin": "1.7.7",
|
||||||
|
"@vitejs/plugin-react-swc": "^3.2.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-native-svg": "^13.8.0",
|
"react-native-svg": "^13.8.0",
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { Divider, IconButton, Paragraph } from '@status-im/components'
|
|
||||||
import {
|
import {
|
||||||
ArrowLeftIcon,
|
ArrowLeftIcon,
|
||||||
CommunitiesIcon,
|
CommunitiesIcon,
|
||||||
@ -14,7 +13,10 @@ import {
|
|||||||
import { Stack, Text } from '@tamagui/core'
|
import { Stack, Text } from '@tamagui/core'
|
||||||
import { BlurView } from 'expo-blur'
|
import { BlurView } from 'expo-blur'
|
||||||
|
|
||||||
|
import { Divider } from '../divider'
|
||||||
import { DropdownMenu } from '../dropdown-menu'
|
import { DropdownMenu } from '../dropdown-menu'
|
||||||
|
import { IconButton } from '../icon-button'
|
||||||
|
import { Paragraph } from '../typography'
|
||||||
|
|
||||||
import type { Channel } from '../sidebar/mock-data'
|
import type { Channel } from '../sidebar/mock-data'
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import { tamaguiPlugin } from '@tamagui/vite-plugin'
|
|||||||
import react from '@vitejs/plugin-react-swc'
|
import react from '@vitejs/plugin-react-swc'
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
|
|
||||||
import type { PluginOption } from 'vite'
|
import { dependencies, peerDependencies } from './package.json'
|
||||||
|
|
||||||
const tamaguiConfig = {
|
const tamaguiConfig = {
|
||||||
components: [],
|
components: [],
|
||||||
@ -10,14 +10,40 @@ const tamaguiConfig = {
|
|||||||
// useReactNativeWebLite: true,
|
// useReactNativeWebLite: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://vitejs.dev/config
|
const external = [
|
||||||
export default defineConfig({
|
...Object.keys(dependencies || {}),
|
||||||
|
...Object.keys(peerDependencies || {}),
|
||||||
|
].map(name => new RegExp(`^${name}(/.*)?`))
|
||||||
|
|
||||||
|
export default defineConfig(({ mode }) => {
|
||||||
|
return {
|
||||||
define: {
|
define: {
|
||||||
TAMAGUI_TARGET: JSON.stringify('web'),
|
TAMAGUI_TARGET: JSON.stringify('web'),
|
||||||
},
|
},
|
||||||
|
build: {
|
||||||
|
target: 'es2020',
|
||||||
|
lib: {
|
||||||
|
entry: './src/index.tsx',
|
||||||
|
fileName: 'index',
|
||||||
|
formats: ['es', 'cjs'],
|
||||||
|
},
|
||||||
|
sourcemap: true,
|
||||||
|
emptyOutDir: mode === 'production',
|
||||||
|
rollupOptions: {
|
||||||
|
external,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
plugins: [
|
plugins: [
|
||||||
react(),
|
react({
|
||||||
tamaguiPlugin(tamaguiConfig) as PluginOption,
|
// jsxRuntime: 'classic',
|
||||||
|
}),
|
||||||
|
tamaguiPlugin(tamaguiConfig),
|
||||||
// tamaguiExtractPlugin(tamaguiConfig)
|
// tamaguiExtractPlugin(tamaguiConfig)
|
||||||
],
|
],
|
||||||
|
|
||||||
|
test: {
|
||||||
|
environment: 'happy-dom',
|
||||||
|
},
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user