calcom/packages/embeds/embed-snippet/vite.config.js
Hariom Balhara 67cc3a6409
Embed Code Generator: Fix Preview HTML and Embed Lib path for production (#2688)
* Improve logging

* Improve logging

* Keep embed origin conigurable

* Make embed URL and embed origin conigurable through env

* Gitignore public embed

* Add fingerprint to preview as well

* Fix path

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-05-06 15:56:26 +00:00

21 lines
494 B
JavaScript

require("dotenv").config({ path: "../../../.env" });
const path = require("path");
const { defineConfig } = require("vite");
process.env.NEXT_PUBLIC_VERCEL_URL = process.env.VERCEL_URL;
module.exports = defineConfig({
build: {
envPrefix: "NEXT_PUBLIC_",
lib: {
entry: path.resolve(__dirname, "src", "index.ts"),
name: "snippet",
fileName: (format) => `snippet.${format}.js`,
},
minify: "terser",
terserOptions: {
compress: true,
},
},
});