-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmitosis.config.js
More file actions
64 lines (64 loc) · 1.9 KB
/
Copy pathmitosis.config.js
File metadata and controls
64 lines (64 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/**
* Mitosis build configuration for @bitcode/ui.
*
* Targets (per ADR-006 §6):
* - react : web React 18+ (consumed by Vite/Tauri)
* - vue : web Vue 3 (consumed by Vite)
* - reactNative : RN with NativeWind className output (consumed by Metro)
* - stencil : legacy Web Components target (frozen — no new features)
*
* NativeWind support:
* `stylesType: 'native-wind'` instructs Mitosis to combine static + dynamic
* class state into a single `className` prop on each JSX node, which
* NativeWind v4's babel transform then compiles into RN styles. Mitosis
* 0.13.1's upstream plugin has a bug stringifying dynamic class bindings
* to "[object Object]"; we ship a `patch-package` patch that fixes the
* plugin in place — see `patches/@builder.io+mitosis+0.13.1.patch`.
*
* @type {import('@builder.io/mitosis').MitosisConfig}
*/
export default {
files: 'src/**/**.lite.tsx',
// Note: target key is camelCase 'reactNative' (matches the export name in
// @builder.io/mitosis targets registry). The output folder is kebab-case
// 'react-native' for filesystem readability — see getTargetPath below.
targets: ['stencil', 'react', 'vue', 'reactNative'],
dest: 'output',
commonOptions: {
typescript: true,
prettier: true,
},
options: {
stencil: {
prefix: 'bc',
},
react: {
stateType: 'useState',
stylesType: 'styled-jsx',
type: 'dom',
},
vue: {
api: 'composition',
vueVersion: 3,
typescript: true,
},
reactNative: {
stateType: 'useState',
stylesType: 'native-wind',
},
},
getTargetPath: ({ target }) => {
switch (target) {
case 'stencil':
return 'stencil';
case 'react':
return 'react';
case 'vue':
return 'vue';
case 'reactNative':
return 'react-native';
default:
return target;
}
},
};