2022-05-06 15:56:26 +00:00
|
|
|
require("dotenv").config({ path: "../../../.env" });
|
|
|
|
|
2022-03-31 08:45:47 +00:00
|
|
|
const path = require("path");
|
|
|
|
const { defineConfig } = require("vite");
|
|
|
|
|
2022-05-06 15:56:26 +00:00
|
|
|
process.env.NEXT_PUBLIC_VERCEL_URL = process.env.VERCEL_URL;
|
|
|
|
|
2022-03-31 08:45:47 +00:00
|
|
|
module.exports = defineConfig({
|
|
|
|
build: {
|
2022-05-06 15:56:26 +00:00
|
|
|
envPrefix: "NEXT_PUBLIC_",
|
2022-03-31 08:45:47 +00:00
|
|
|
lib: {
|
2022-04-04 15:44:04 +00:00
|
|
|
entry: path.resolve(__dirname, "src", "index.ts"),
|
2022-03-31 08:45:47 +00:00
|
|
|
name: "snippet",
|
|
|
|
fileName: (format) => `snippet.${format}.js`,
|
|
|
|
},
|
2022-05-05 14:29:49 +00:00
|
|
|
minify: "terser",
|
|
|
|
terserOptions: {
|
|
|
|
compress: true,
|
|
|
|
},
|
2022-03-31 08:45:47 +00:00
|
|
|
},
|
|
|
|
});
|