Set up web app deployment (#399)
* env * vercel.json * u * global * ignore * preview * vercel * turbo * fix turbo * rm TAMAGUI_DISABLE_WARN_DYNAMIC_LOAD * use globaThis
This commit is contained in:
parent
539eb6f35d
commit
12428280cf
|
@ -0,0 +1 @@
|
|||
TAMAGUI_TARGET=web
|
|
@ -0,0 +1 @@
|
|||
TAMAGUI_TARGET=web
|
|
@ -0,0 +1 @@
|
|||
TAMAGUI_TARGET=web
|
|
@ -22,3 +22,7 @@ dist-ssr
|
|||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
# local env files
|
||||
!.env.*
|
||||
.env*.local
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"dev": "TAMAGUI_TARGET='web' vite",
|
||||
"build": "tsc && vite build",
|
||||
"preview": "vite preview",
|
||||
"dev": "TAMAGUI_TARGET=web vite",
|
||||
"build": "tsc && TAMAGUI_TARGET=web vite build",
|
||||
"preview": "TAMAGUI_TARGET=web vite preview",
|
||||
"lint": "eslint src",
|
||||
"typecheck": "tsc",
|
||||
"clean": "rimraf node_modules .turbo"
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"$schema": "https://openapi.vercel.sh/vercel.json",
|
||||
"git": {
|
||||
"deploymentEnabled": {
|
||||
"main": false
|
||||
}
|
||||
},
|
||||
"ignoreCommand": "git diff --quiet HEAD^ HEAD ../../{patches,package.json,turbo.json} ../../packages/{colors,components,icons,status-js} ./",
|
||||
"installCommand": "yarn install --cwd ../../ --frozen-lockfile",
|
||||
"buildCommand": "turbo run build --cwd ../../ --filter=web..."
|
||||
}
|
|
@ -1,13 +1,10 @@
|
|||
import { tamaguiPlugin } from '@tamagui/vite-plugin'
|
||||
import react from '@vitejs/plugin-react-swc'
|
||||
import path from 'path'
|
||||
import { defineConfig } from 'vite'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
|
||||
import type { PluginOption } from 'vite'
|
||||
|
||||
process.env.TAMAGUI_TARGET = 'web'
|
||||
process.env.TAMAGUI_DISABLE_WARN_DYNAMIC_LOAD = '1'
|
||||
|
||||
const tamaguiConfig = {
|
||||
components: ['@status-im/components'],
|
||||
config: './tamagui.config.ts',
|
||||
|
@ -15,7 +12,10 @@ const tamaguiConfig = {
|
|||
}
|
||||
|
||||
// @see: https://vitejs.dev/config
|
||||
export default defineConfig({
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '')
|
||||
|
||||
return {
|
||||
resolve: {
|
||||
// mainFields: ['module', 'jsnext:main', 'jsnext'],
|
||||
alias: {
|
||||
|
@ -26,11 +26,14 @@ export default defineConfig({
|
|||
},
|
||||
},
|
||||
define: {
|
||||
TAMAGUI_TARGET: JSON.stringify('web'),
|
||||
// @see https://github.com/tamagui/tamagui/blob/a0d5fa0d05e6988a7cfa2a5e7823f295b82bae10/packages/tamagui/src/setup.ts#LL20C1-L20C28
|
||||
global: 'globalThis',
|
||||
'process.env.TAMAGUI_TARGET': JSON.stringify(env.TAMAGUI_TARGET),
|
||||
},
|
||||
plugins: [
|
||||
react(),
|
||||
tamaguiPlugin(tamaguiConfig) as PluginOption,
|
||||
// tamaguiExtractPlugin(tamaguiConfig)
|
||||
],
|
||||
}
|
||||
})
|
||||
|
|
|
@ -26,6 +26,7 @@ yarn-error.log*
|
|||
.pnpm-debug.log*
|
||||
|
||||
# local env files
|
||||
!.env.*
|
||||
.env*.local
|
||||
|
||||
# vercel
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"lint": "next lint",
|
||||
"typecheck": "tsc",
|
||||
"clean": "rimraf .next .tamagui .vercel/output node_modules",
|
||||
"serve": "next start --port 8151"
|
||||
"preview": "next start --port 8151"
|
||||
},
|
||||
"dependencies": {
|
||||
"@radix-ui/react-dialog": "^1.0.3",
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"main": false
|
||||
}
|
||||
},
|
||||
"ignoreCommand": "git diff --quiet HEAD^ HEAD ../../{patches,package.json} ../../packages/{colors,components,icons} ./",
|
||||
"ignoreCommand": "git diff --quiet HEAD^ HEAD ../../{patches,package.json,turbo.json} ../../packages/{colors,components,icons,status-js} ./",
|
||||
"installCommand": "yarn install --cwd ../../ --frozen-lockfile",
|
||||
"buildCommand": "turbo run build --cwd ../../ --filter=website..."
|
||||
}
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
"dependsOn": ["^build"],
|
||||
"outputs": ["dist/**"]
|
||||
},
|
||||
"web#build": {
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": ["dist/**"]
|
||||
},
|
||||
"website#build": {
|
||||
"dependsOn": ["^build"],
|
||||
"env": ["TAMAGUI_TARGET", "TAMAGUI_DISABLE_WARN_DYNAMIC_LOAD"],
|
||||
|
|
Loading…
Reference in New Issue