BuilderIO/mitosis

Project Compiling CLI

Open

#173 geöffnet am 13. Feb. 2022

Auf GitHub ansehen
 (1 Kommentar) (1 Reaktion) (1 zugewiesene Person)TypeScript (9.803 Stars) (411 Forks)batch import
enhancementhelp wanted

Beschreibung

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

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

could compile to a fully installable package per framework, like

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

import { MyComponent } from 'project-name/react'

or

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