-
Notifications
You must be signed in to change notification settings - Fork 11
/
stencil.config.ts
107 lines (105 loc) · 2.91 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
import { Config } from '@stencil/core'
import { postcss } from '@stencil/postcss'
import { reactOutputTarget } from '@stencil/react-output-target'
import { WebTypesGenerator } from 'stenciljs-web-types-generator/web-types-generator'
import {
ComponentModelConfig,
vueOutputTarget,
} from '@stencil/vue-output-target'
import * as postcssConfig from './config/postcss.config.cjs'
const vueComponentModels: ComponentModelConfig[] = [
{
elements: ['ld-input', 'ld-slider'],
event: 'input',
externalEvent: 'input',
targetAttr: 'value',
},
{
elements: ['ld-checkbox', 'ld-toggle'],
event: 'input',
externalEvent: 'input',
targetAttr: 'checked',
},
]
export const config: Config = {
namespace: 'liquid',
srcDir: 'src/liquid',
globalStyle: 'src/liquid/global/styles/global.css',
outputTargets: [
reactOutputTarget({
componentCorePackage: '../dist/components',
proxiesFile: './out/react.ts',
includeDefineCustomElements: true,
}),
vueOutputTarget({
componentCorePackage: '../dist/components',
proxiesFile: './out/vue.ts',
includeDefineCustomElements: true,
componentModels: vueComponentModels,
}),
{
type: 'dist',
},
{
type: 'dist-custom-elements',
customElementsExportBehavior: 'auto-define-custom-elements',
},
{
type: 'docs-readme',
},
{
type: 'docs-vscode',
file: 'tmp/web-components.html-data.json',
},
{
type: 'docs-json',
file: 'dist/web-components.json',
},
{
type: 'dist-hydrate-script',
},
{
type: 'docs-custom',
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
generator: new WebTypesGenerator({
name: '@emdgroup-liquid/liquid',
version: 'latest',
defaultIconPath:
'https://liquid.merck.design/liquid/dist/build/assets/logo.svg',
outputPath: 'dist/web-types.json',
}).generateWebTypesJson,
},
],
plugins: [postcss(postcssConfig)],
testing: {
allowableMismatchedPixels: 10,
setupFiles: ['./config/jest.setup.js'],
moduleDirectories: ['node_modules', '<rootDir>'],
timers: 'legacy',
emulate: [
{
viewport: {
width: 600,
height: 600,
// A device scale factor of 2 would reduce issues with antialiasing.
// However, testing then takes longer and screenshot matching
// tends to time out, especially when running all tests in one go.
// That is why we do without the higher device scale factor, for now.
// deviceScaleFactor: 2,
},
},
],
// browserHeadless: false,
// browserDevtools: true,
// browserSlowMo: 1000, // milliseconds
},
buildEs5: false,
extras: {
experimentalImportInjection: true,
scriptDataOpts: false,
appendChildSlotFix: false,
cloneNodeFix: false,
slotChildNodesFix: false,
},
}