2022-09-24 03:49:40 +00:00
|
|
|
require('dotenv').config()
|
2022-09-24 04:08:35 +00:00
|
|
|
const package = require("./package.json");
|
2022-09-24 03:49:40 +00:00
|
|
|
const path = require("path");
|
|
|
|
const { build } = require("esbuild");
|
|
|
|
|
|
|
|
const options = {
|
|
|
|
entryPoints: ["./src/index.tsx"],
|
|
|
|
outfile: path.resolve(__dirname, "../files/assets/js/chat_done.js"),
|
|
|
|
bundle: true,
|
2022-09-24 03:51:10 +00:00
|
|
|
minify: process.env.NODE_ENV === "production",
|
2022-09-24 03:49:40 +00:00
|
|
|
define: {
|
2022-09-24 04:08:35 +00:00
|
|
|
"process.env.VERSION": `"${package.version}"`,
|
2022-09-24 03:49:40 +00:00
|
|
|
"process.env.NODE_ENV": `"${process.env.NODE_ENV}"`,
|
|
|
|
"process.env.DEBUG": process.env.DEBUG,
|
|
|
|
"process.env.FEATURES_ACTIVITY": process.env.FEATURES_ACTIVITY,
|
|
|
|
"process.env.EMOJI_INPUT_TOKEN": `"${process.env.EMOJI_INPUT_TOKEN}"`,
|
|
|
|
"process.env.QUICK_EMOJIS_MAX_COUNT": process.env.QUICK_EMOJIS_MAX_COUNT,
|
|
|
|
"process.env.APPROXIMATE_CHARACTER_WIDTH": process.env.APPROXIMATE_CHARACTER_WIDTH,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
build(options).catch(() => process.exit(1));
|