forked from ionic-team/stencil-ds-output-targets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stencil.config.ts
122 lines (118 loc) · 2.94 KB
/
stencil.config.ts
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import { Config } from '@stencil/core';
import { angularOutputTarget, ValueAccessorConfig } from '@stencil/angular-output-target';
import { reactOutputTarget } from '@stencil/react-output-target';
import { vueOutputTarget, ComponentModelConfig } from '@stencil/vue-output-target';
import { svelteOutputTarget, ComponentBindingConfig } from '@stencil/svelte-output-target';
const angularValueAccessorBindings: ValueAccessorConfig[] = [
{
elementSelectors: ['my-input[type=text]'],
event: 'myChange',
targetAttr: 'value',
type: 'text',
},
{
elementSelectors: ['my-input[type=number]'],
event: 'myChange',
targetAttr: 'value',
type: 'number',
},
{
elementSelectors: ['my-checkbox'],
event: 'myChange',
targetAttr: 'checked',
type: 'boolean',
},
{
elementSelectors: ['my-radio'],
event: 'mySelect',
targetAttr: 'checked',
type: 'radio',
},
{
elementSelectors: ['my-range', 'my-radio-group'],
event: 'myChange',
targetAttr: 'value',
type: 'select',
},
];
const vueComponentModels: ComponentModelConfig[] = [
{
elements: ['my-input', 'my-range'],
event: 'myChange',
targetAttr: 'value',
},
{
elements: ['my-checkbox'],
event: 'myChange',
targetAttr: 'checked',
},
{
elements: ['my-radio'],
event: 'mySelect',
targetAttr: 'checked',
},
{
elements: ['my-range', 'my-radio-group'],
event: 'myChange',
targetAttr: 'value',
},
];
const svelteComponentBindings: ComponentBindingConfig[] = [
{
elements: ['my-input', 'my-range'],
event: 'myChange',
targetProp: 'value',
},
{
elements: ['my-checkbox'],
event: 'myChange',
targetProp: 'checked',
},
{
elements: ['my-radio'],
event: 'mySelect',
targetProp: 'checked',
},
{
elements: ['my-range', 'my-radio-group'],
event: 'myChange',
targetProp: 'value',
},
];
export const config: Config = {
namespace: 'component-library',
taskQueue: 'async',
outputTargets: [
angularOutputTarget({
componentCorePackage: 'component-library',
directivesProxyFile: '../component-library-angular/src/directives/proxies.ts',
valueAccessorConfigs: angularValueAccessorBindings,
}),
reactOutputTarget({
componentCorePackage: 'component-library',
proxiesFile: '../component-library-react/src/components.ts',
}),
vueOutputTarget({
componentCorePackage: 'component-library',
proxiesFile: '../component-library-vue/src/proxies.ts',
componentModels: vueComponentModels,
}),
svelteOutputTarget({
accessors: true,
componentCorePackage: 'component-library',
proxiesFile: '../component-library-svelte/src/proxies.ts',
componentBindings: svelteComponentBindings,
}),
{
type: 'dist',
esmLoaderPath: '../loader',
},
{
type: 'docs-readme',
},
{
type: 'www',
serviceWorker: null, // disable service workers
},
],
};