Felicio Mununga 665d2df7e8
Setup apps/website (#383)
* scaffold website project with Next.js

* set tamagui target

* remove whitespace

* update clean npm scripts

* apply patches post-install

* lock tamagui version

* add patch-package to root

* patch @tamagui/core-node

* patch @tamagui/normalize-css-color

* patch @achingbrain/ssdp

* remove patches from website

* update clean script in website

* remove @tamagui/vite-plugin from dependencies

* patch @tamagui/static

* update node-version

* define env vars
2023-04-26 12:06:18 +02:00

49 lines
1.1 KiB
TypeScript

import { tamaguiPlugin } from '@tamagui/vite-plugin'
import react from '@vitejs/plugin-react-swc'
import { defineConfig } from 'vite'
import { dependencies, peerDependencies } from './package.json'
const tamaguiConfig = {
components: [],
config: './src/tamagui.config.ts',
// useReactNativeWebLite: true,
}
const external = [
...Object.keys(dependencies || {}),
...Object.keys(peerDependencies || {}),
].map(name => new RegExp(`^${name}(/.*)?`))
export default defineConfig(({ mode }) => {
return {
define: {
'process.env.TAMAGUI_TARGET': JSON.stringify('web'),
'process.env.INCLUDE_CSS_COLOR_NAMES': JSON.stringify(false),
},
build: {
target: 'es2020',
lib: {
entry: './src/index.tsx',
fileName: 'index',
formats: ['es', 'cjs'],
},
sourcemap: true,
emptyOutDir: mode === 'production',
rollupOptions: {
external,
},
},
plugins: [
react(),
tamaguiPlugin(tamaguiConfig),
// tamaguiExtractPlugin(tamaguiConfig),
],
test: {
environment: 'happy-dom',
},
}
})