* add wavesurfer-provider * brand new layout for player * refactor pitch contour * clean up * update styl * refactor * update layout * use new layout for video * refactor * may select word * may edit word timestamp * may toggle multiselect words * clean code * improve word region update * improve layout * update layout * add echogarden * fix test * use aligned transcription * fix ipa * some refactor * improve code * implement ipa & translate & lookup * recording play & share * fix * fix post audio * improve layout * may delete recording * may record * fix video player layout * fix player in conversation * render recording along with orignal audio * may custom create region in recording * fix float issue when seekTo * fix recording player * fix load more recordings * fix seekTo * clean up * refactor pitch contour * fix some warnings * upgrade deps * fix group transcription sentence * zoom to fit when segment update * add more hotkeys * update player layout * improve style * play recording overlap audio when comparing * update echogarden dep * add recorded mark on transcription * fix recording pitch contour rendering * improve recording * adjust pitch finder params
83 lines
2.1 KiB
TypeScript
83 lines
2.1 KiB
TypeScript
import { viteStaticCopy } from "vite-plugin-static-copy";
|
|
import os from "os";
|
|
import path from "path";
|
|
import type { ConfigEnv, UserConfig } from "vite";
|
|
import { defineConfig, mergeConfig } from "vite";
|
|
import {
|
|
getBuildConfig,
|
|
getBuildDefine,
|
|
pluginHotRestart,
|
|
external,
|
|
} from "./vite.base.config";
|
|
|
|
// https://vitejs.dev/config
|
|
export default defineConfig((env) => {
|
|
const forgeEnv = env as ConfigEnv<"build">;
|
|
const { forgeConfigSelf } = forgeEnv;
|
|
const define = getBuildDefine(forgeEnv);
|
|
const config: UserConfig = {
|
|
build: {
|
|
lib: {
|
|
entry: forgeConfigSelf.entry!,
|
|
fileName: () => "[name].js",
|
|
formats: ["es"],
|
|
},
|
|
rollupOptions: {
|
|
external: [...external, "echogarden/dist/api/API.js"],
|
|
output: {
|
|
strict: false,
|
|
},
|
|
plugins: [],
|
|
},
|
|
commonjsOptions: {
|
|
transformMixedEsModules: true,
|
|
defaultIsModuleExports: true,
|
|
esmExternals: true,
|
|
},
|
|
},
|
|
plugins: [
|
|
pluginHotRestart("restart"),
|
|
viteStaticCopy({
|
|
targets: [
|
|
{
|
|
src: `lib/whisper.cpp/${
|
|
process.env.PACKAGE_OS_ARCH || os.arch()
|
|
}/${os.platform()}/*`,
|
|
dest: "lib/whisper",
|
|
},
|
|
{
|
|
src: `lib/whisper.cpp/models/*`,
|
|
dest: "lib/whisper/models",
|
|
},
|
|
{
|
|
src: `lib/youtubedr/${
|
|
process.env.PACKAGE_OS_ARCH || os.arch()
|
|
}/${os.platform()}/*`,
|
|
dest: "lib/youtubedr",
|
|
},
|
|
{
|
|
src: "src/main/db/migrations/*",
|
|
dest: "migrations",
|
|
},
|
|
{
|
|
src: "samples/*",
|
|
dest: "samples",
|
|
},
|
|
],
|
|
}),
|
|
],
|
|
define,
|
|
resolve: {
|
|
// Load the Node.js entry.
|
|
mainFields: ["module", "jsnext:main", "jsnext"],
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
"@main": path.resolve(__dirname, "./src/main"),
|
|
"@commands": path.resolve(__dirname, "./src/commands"),
|
|
},
|
|
},
|
|
};
|
|
|
|
return mergeConfig(getBuildConfig(forgeEnv), config);
|
|
});
|