BuilderIO / BuilderIO/mitosis

Project Compiling CLI

Open
#173 1 comment 1 reaction 1 assignee Claimed by @samijaber View on GitHub
enhancement help wanted
Dominant language
TypeScript
Stars
14.4k
Forks
672
PR merge metrics
No merged PRs in 30d

Description

Today, we only compile one file at a time. What would be most useful for most peoples setups, though, would be to compile a _project_, for instance

```bash
package.json
src/
my-component.lite.tsx
my-dependency.ts
```

could compile to a fully installable package per framework, like

```bash
dist/
package.json
react/
my-component.js # compiled to react JS
my-dependency.js
vue/
my-component.js # compiled to Vue
my-dependency.js
```

where you can do like

```jsx
import { MyComponent } from 'project-name/react'
```
or
```jsx
import { MyComponent } from 'project-name/vue'
```

we have begun exploring this direction. a few things we've noticed

- vue2 vs vue3 have different ways of compiling. and nuxt2 doesn't want precompiled components. so even per framework we might want different outputs in different folders. like `vue2/`, `vue3/`, `nuxt2/`, etc
- some frameworks, like react native, need overrides. so we started experimenting with an `overrides/` folder convention where you can override any file per-output, and it just compiles and copies over to the dist/output dir

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.