BuilderIO/mitosis

Project Compiling CLI

Open

#173 aperta il 13 feb 2022

Vedi su GitHub
 (1 commento) (1 reazione) (1 assegnatario)TypeScript (411 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (9803 star)
Metriche merge PR
 (Merge medio 1g 1h) (6 PR mergiate in 30 g)

Descrizione

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

Guida contributor