build: add release build script

This commit is contained in:
Tristan Yang
2022-07-31 23:31:19 +08:00
parent b83d687e1e
commit c12b94742a
2 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -94,7 +94,8 @@
"scripts": {
"start": "REACT_APP_BUILD_TIME=$(date +%s) node scripts/start.js",
"build": "rm -rf build && REACT_APP_BUILD_TIME=$(date +%s) GENERATE_SOURCEMAP=false node scripts/build.js",
"deploy": "yarn build && gh-pages -d build",
"build:release": "rm -rf build && REACT_APP_BUILD_TIME=$(date +%s) REACT_APP_RELEASE=true GENERATE_SOURCEMAP=false node scripts/build.js",
"deploy:demo": "yarn build && gh-pages -d build",
"lint": "lint-staged",
"prepare": "husky install",
"postinstall": "patch-package"
+4 -1
View File
@@ -1,5 +1,8 @@
// const BASE_URL = `${location.origin}/api`;
const BASE_URL = `https://dev.voce.chat/api`;
const BASE_URL = process.env.REACT_APP_RELEASE
? `${location.origin}/api`
: `https://dev.voce.chat/api`;
// const BASE_URL = `https://dev.voce.chat/api`;
export const CACHE_VERSION = `0.3.1`;
export const ContentTypes = {
text: "text/plain",