Add fingerprint to preview as well

miscellaneous-fixes-embed
Hariom Balhara 2022-05-06 17:59:07 +05:30
parent ddc9b1c903
commit e0d377d2dc
3 changed files with 5 additions and 4 deletions

View File

@ -6,10 +6,8 @@
"scripts": {
"__build": "yarn tailwind && vite build",
"__dev": "yarn __build --mode development",
"clean-copy-to-web": "rm -rf ../../../apps/web/public/embed && mkdir -p ../../../apps/web/public/embed && cp -r dist/* ../../../apps/web/public/embed/",
"build": "NEXT_PUBLIC_EMBED_FINGER_PRINT=$(git rev-parse --short HEAD) yarn __build && yarn clean-copy-to-web",
"build": "NEXT_PUBLIC_EMBED_FINGER_PRINT=$(git rev-parse --short HEAD) yarn __build",
"build-preview": "PREVIEW_BUILD=1 yarn __build ",
"build:cal": "NEXT_PUBLIC_WEBAPP_URL='https://app.cal.com' yarn build && cp dist/embed.js ../../../apps/website/public/embed.js && echo 'You need to commit the newly generated embed.js in apps/website'",
"vite": "vite",
"tailwind": "yarn tailwindcss -i ./src/styles.css -o ./src/tailwind.generated.css",
"buildWatchAndServer": "run-p '__dev' 'vite --port 3100 --strict-port --open'",

View File

@ -4,6 +4,8 @@ const WEBAPP_URL =
import.meta.env.NEXT_PUBLIC_WEBAPP_URL || `https://${import.meta.env.NEXT_PUBLIC_VERCEL_URL}`;
const EMBED_LIB_URL = import.meta.env.NEXT_PUBLIC_EMBED_LIB_URL || `${WEBAPP_URL}/embed/embed.js`;
(window as any).fingerprint = import.meta.env.NEXT_PUBLIC_EMBED_FINGER_PRINT as string;
// Install Cal Embed Code Snippet
(function (C, A, L) {
// @ts-ignore

View File

@ -23,7 +23,8 @@ module.exports = defineConfig((configEnv) => {
output: {
entryFileNames: "[name].js",
//FIXME: Can't specify UMD as import because preview is an app which doesn't support `format` and this setting apply to both input
//format: "umd"
//format: "umd",
dir: "../../../apps/web/public/embed",
},
},
},