fix frontend build
This commit is contained in:
@ -4,8 +4,8 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "VITE_DISABLE_TYPESCRIPT_CHECKER=true VITE_DISABLE_ESLINT_CHECKER=true NODE_OPTIONS=--max-old-space-size=4000 npx vite build && bash ./scripts/inject-runtime-env.sh",
|
||||
"build:sourcemaps": "VITE_BUILD_SOURCEMAP=true VITE_DISABLE_TYPESCRIPT_CHECKER=true VITE_DISABLE_ESLINT_CHECKER=true NODE_OPTIONS=--max-old-space-size=6000 npx vite build && bash ./scripts/inject-runtime-env.sh",
|
||||
"build": "VITE_DISABLE_TYPESCRIPT_CHECKER=true VITE_DISABLE_ESLINT_CHECKER=true NODE_OPTIONS=--max-old-space-size=4000 npx vite build && sh ./scripts/inject-runtime-env.sh",
|
||||
"build:sourcemaps": "VITE_BUILD_SOURCEMAP=true VITE_DISABLE_TYPESCRIPT_CHECKER=true VITE_DISABLE_ESLINT_CHECKER=true NODE_OPTIONS=--max-old-space-size=6000 npx vite build && sh ./scripts/inject-runtime-env.sh",
|
||||
"start:prod": "NODE_ENV=production npx vite --host",
|
||||
"tsup": "npx tsup"
|
||||
},
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
echo "Injecting runtime environment variables into index.html..."
|
||||
|
||||
@ -13,7 +13,7 @@ EOF
|
||||
)
|
||||
# Use sed to replace the config block in index.html
|
||||
# Using pattern space to match across multiple lines
|
||||
sed -i.bak '
|
||||
echo "$CONFIG_BLOCK" | sed -i.bak '
|
||||
/<!-- BEGIN: Twenty Config -->/,/<!-- END: Twenty Config -->/{
|
||||
/<!-- BEGIN: Twenty Config -->/!{
|
||||
/<!-- END: Twenty Config -->/!d
|
||||
@ -21,5 +21,5 @@ sed -i.bak '
|
||||
/<!-- BEGIN: Twenty Config -->/r /dev/stdin
|
||||
/<!-- END: Twenty Config -->/d
|
||||
}
|
||||
' build/index.html <<< "$CONFIG_BLOCK"
|
||||
' build/index.html
|
||||
rm -f build/index.html.bak
|
||||
|
||||
Reference in New Issue
Block a user