build: add official demo option
This commit is contained in:
+1
-1
@@ -98,7 +98,7 @@
|
|||||||
"start": "REACT_APP_BUILD_TIME=$(date +%s) node scripts/start.js",
|
"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",
|
"build": "rm -rf build && REACT_APP_BUILD_TIME=$(date +%s) GENERATE_SOURCEMAP=false node scripts/build.js",
|
||||||
"build:release": "rm -rf build && REACT_APP_BUILD_TIME=$(date +%s) REACT_APP_RELEASE=true GENERATE_SOURCEMAP=false node scripts/build.js",
|
"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",
|
"deploy:demo": "REACT_APP_OFFICIAL_DEMO=true yarn build && gh-pages -d build",
|
||||||
"lint": "lint-staged",
|
"lint": "lint-staged",
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"postinstall": "patch-package"
|
"postinstall": "patch-package"
|
||||||
|
|||||||
+4
-3
@@ -12,12 +12,13 @@ let prices: Price[] = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
const official_dev = `https://dev.voce.chat`;
|
const official_dev = `https://dev.voce.chat`;
|
||||||
// const local_dev = `http://localhost:3000`;
|
// const local_dev = `https://dev.voce.chat`;
|
||||||
const local_dev = official_dev;
|
const local_dev = `http://localhost:3000`;
|
||||||
|
const dev_origin = process.env.REACT_APP_OFFICIAL_DEMO ? official_dev : local_dev;
|
||||||
|
|
||||||
// const local_dev = `http://07333.qicp.vip:3030`;
|
// const local_dev = `http://07333.qicp.vip:3030`;
|
||||||
// const local_dev = `https://im.ttt.td`;
|
// const local_dev = `https://im.ttt.td`;
|
||||||
export const BASE_ORIGIN = process.env.REACT_APP_RELEASE ? `${location.origin}` : local_dev;
|
export const BASE_ORIGIN = process.env.REACT_APP_RELEASE ? `${location.origin}` : dev_origin;
|
||||||
export const IS_OFFICIAL_DEMO = BASE_ORIGIN === official_dev;
|
export const IS_OFFICIAL_DEMO = BASE_ORIGIN === official_dev;
|
||||||
|
|
||||||
const BASE_URL = `${BASE_ORIGIN}/api`;
|
const BASE_URL = `${BASE_ORIGIN}/api`;
|
||||||
|
|||||||
Reference in New Issue
Block a user