-
Notifications
You must be signed in to change notification settings - Fork 0
/
stencil.config.ts
47 lines (45 loc) · 1.18 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
import { Config } from '@stencil/core';
import { postcss } from '@stencil/postcss';
import replace from 'postcss-replace';
import purgecss from '@fullhuman/postcss-purgecss';
import cssnano from 'cssnano';
const purge = purgecss({
content: ['./src/**/*.tsx', './src/index.html'],
safelist: [':host'],
defaultExtractor: content => content.match(/[A-Za-z0-9-_:/]+/g) || [],
});
export const config: Config = {
devServer: {
openBrowser: !process.env.NOBROWSER,
},
namespace: 'leibal-components',
outputTargets: [
{
type: 'dist',
esmLoaderPath: '../loader',
},
{
type: 'dist-custom-elements',
},
{
type: 'docs-readme',
},
{
type: 'www',
serviceWorker: null, // disable service workers
},
],
plugins: [
postcss({
plugins: [
require('postcss-import'),
require('tailwindcss/nesting'),
require('tailwindcss')('./tailwind.config.js'),
require('autoprefixer'),
replace({ pattern: 'html', data: { replaceAll: ':host' } } as any),
// purge and cssnano if production build
...(!process.argv.includes('--dev') ? [purge, cssnano()] : []),
],
}),
],
};