-
Notifications
You must be signed in to change notification settings - Fork 83
/
stencil.config.ts
93 lines (92 loc) · 2.45 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
import { Config } from '@stencil/core';
import { postcss } from '@stencil/postcss';
import postcssCustomMedia from 'postcss-custom-media';
import { frameworkTargets } from './framework-targets';
import { inlineSvg } from 'stencil-inline-svg';
export const config: Config = {
devServer: {
startupTimeout: 120000,
},
tsconfig: process.env.WHITELABEL
? 'tsconfig.whitelabel.json'
: 'tsconfig.json',
testing: {
testRegex: '/src/.*\\.(spec|e2e)\\.(ts|tsx)$',
collectCoverageFrom: [
'**/src/**/*.{ts,tsx}',
'!**/node_modules/**',
'!**/*.{d,esm,iife,styles}.ts',
],
setupFilesAfterEnv: ['./test-setup.ts'],
},
namespace: 'scale-components',
globalScript: 'src/global/scale.ts',
globalStyle: process.env.WHITELABEL
? 'src/global/whitelabel.css'
: 'src/global/scale.css',
plugins: [
inlineSvg(),
postcss({
plugins: [postcssCustomMedia()],
}),
],
outputTargets: [
...frameworkTargets,
{
type: 'dist',
esmLoaderPath: '../loader',
copy: [
// do not include fonts files for whitelabel build
...(process.env.WHITELABEL
? []
: [
{
src: 'telekom/fonts/TeleNeoWeb',
dest: 'fonts/TeleNeoWeb',
warn: true,
},
]),
// index file with icon information, useful for docs
{ src: 'components/icons/scale-icons.json', warn: true },
// do not publish the telekom/ brand assets folder (in dist/collections/)
{ src: '.npmignore', warn: true },
],
},
{
type: 'dist-custom-elements',
generateTypeDeclarations: true,
},
{
type: 'www',
serviceWorker: null, // disable service workers
copy: [
{
src: 'telekom/fonts/TeleNeoWeb',
dest: 'build/fonts/TeleNeoWeb',
warn: true,
},
{ src: '../../design-tokens/dist/*', dest: 'build/', warn: true },
{ src: './html/*', dest: './', warn: true },
...(!process.env.WHITELABEL
? [{ src: './html/telekom/*', dest: './', warn: true }]
: []),
],
},
{
type: 'docs-readme',
},
{
type: 'docs-vscode',
file: './dist/vscode-data.json',
},
{
type: 'docs-json',
file: './dist/scale-components.json',
},
{ type: 'dist-hydrate-script' },
],
extras: {
cloneNodeFix: true,
experimentalImportInjection: true,
},
};