diff --git a/src/shared-components/index.ts b/src/shared-components/index.ts new file mode 100644 index 0000000000..78d01946ad --- /dev/null +++ b/src/shared-components/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2025 New Vector Ltd. + * + * SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial + * Please see LICENSE files in the repository root for full details. + */ + +export * from "./audio/AudioPlayerView"; +export * from "./audio/Clock"; +export * from "./audio/PlayPauseButton"; +export * from "./audio/SeekBar"; +export * from "./avatar/AvatarWithDetails"; +export * from "./event-tiles/TextualEventView"; +export * from "./message-body/MediaBody"; +export * from "./pill-input/Pill"; +export * from "./pill-input/PillInput"; +export * from "./rich-list/RichItem"; diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000000..c8ed69c0cf --- /dev/null +++ b/vite.config.js @@ -0,0 +1,41 @@ +/* + * Copyright 2025 New Vector Ltd. + * + * SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial + * Please see LICENSE files in the repository root for full details. + */ + +import { dirname, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; +import { defineConfig } from "vite"; + +const __dirname = dirname(fileURLToPath(import.meta.url)); + +export default defineConfig({ + build: { + lib: { + entry: resolve(__dirname, "src/shared-components/index.ts"), + name: "Element Web Shared Components", + // the proper extensions will be added + fileName: "element-web-shared-components", + }, + rollupOptions: { + // make sure to externalize deps that shouldn't be bundled + // into your library + external: ["react"], + output: { + // Provide global variables to use in the UMD build + // for externalized deps + globals: { + react: "react", + }, + }, + }, + }, + resolve: { + alias: { + // Alias used by i18n.tsx + $webapp: resolve(__dirname, "webapp"), + }, + }, +});