-
Notifications
You must be signed in to change notification settings - Fork 1
/
stencil.config.ts
60 lines (58 loc) · 1.42 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
import purgecss from '@fullhuman/postcss-purgecss'
import { Config } from '@stencil/core'
import { postcss } from '@stencil/postcss'
import tailwind from 'tailwindcss'
import { generateJsonDocs } from './jsonDocTransformer'
const prodPlugins =
process.env.NODE_ENV === 'production'
? [
purgecss({
content: ['./src/**/*.html', './src/**/*.tsx'],
defaultExtractor: (content) =>
content.match(/[A-Za-z0-9-_:/]+/g) || [],
}),
]
: []
export const config: Config = {
namespace: 'stencila-components',
buildEs5: 'prod',
extras: {
appendChildSlotFix: true,
cloneNodeFix: true,
dynamicImportShim: true,
safari10: true,
},
globalScript: './src/globals/global.ts',
sourceMap: true,
outputTargets: [
{
type: 'dist',
esmLoaderPath: '../loader',
},
{
type: 'docs-readme',
},
{
type: 'custom',
generator: generateJsonDocs,
name: 'custom-element-docs',
},
{
type: 'www',
serviceWorker: null, // disable service workers
},
],
plugins: [
postcss({
plugins: [tailwind('../../tailwind.config.js'), ...prodPlugins],
}),
],
testing: {
allowableMismatchedRatio: 0.15,
transform: {
'^.+\\.(ts|tsx|jsx|js|css)$':
'<rootDir>/node_modules/@stencil/core/testing/jest-preprocessor.js',
},
transformIgnorePatterns: ['node_modules/(?!(@nll|fp-ts)/)'],
},
}