Make the component installable as a git dependency

`component/package.json` describes the built component as a package
(`@element-hq/element-call-component`: entry, stylesheet subpath, types,
peer dependencies) so that a host can depend on
`github:element-hq/element-call#<ref>&path:/component`. Its `prepare`
script builds on install, since nothing is published yet.

For that the component build now lands in `component/dist` instead of the
repository's `dist`, and `pnpm build:component` also emits the type
declarations (`component/tsconfig.build.json`, `build:component:types`),
which previously had to be produced by hand.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Timo K.
2026-09-04 15:29:55 +02:00
committed by Timo K.
co-authored by Claude Fable 5.1
parent 38c28a1c8f
commit 218ee46b7d
7 changed files with 109 additions and 3 deletions
+4
View File
@@ -38,6 +38,10 @@ export default defineConfig(({ mode }) => {
// confined to the element Element Call is mounted in
css: { postcss: { plugins: [scopeStylesToRoot()] } },
build: {
// Into the package directory, so that `component/package.json` describes
// what sits next to it and the directory can be installed as a package
// (see its `files` and `exports`).
outDir: "component/dist",
minify: mode === "production",
sourcemap: true,
// One stylesheet rather than one per chunk, so a host has a single file to