-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstencil.config.ts
66 lines (64 loc) · 1.81 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
import { Config } from '@stencil/core';
import { sass } from '@stencil/sass';
import { reactOutputTarget } from '@stencil/react-output-target';
import projectConfig from './project-config';
import eventSync from './stencil-build-helpers/rollup/event-sync';
export const config: Config = {
namespace: projectConfig.namespace,
outputTargets: [
{
esmLoaderPath: '../loader',
type: 'dist',
},
{
customElementsExportBehavior: 'auto-define-custom-elements',
externalRuntime: false,
type: 'dist-custom-elements',
},
reactOutputTarget({
// Relative path to where the React components will be generated
outDir: 'dist/react',
/**
* SUPER HACKY... /)
* stencil decided to step away from extensinve configs
* for the components and defineCustomElements import
* for the generated wrapper.
*
* Theyr approach is working if you work in a monorepo,
* so you can save the wrapper in the Dir of the consuming
* app.
*
* If you want an independent component library (saving the
* wrapper to the dist folder) not sitting
* next to the consumer app, this approach does not work
* since you'll have the stencil library name as a starting
* segment in the import of the components.
*/
stencilPackageName: '../..',
}),
{
type: 'docs-readme',
},
{
serviceWorker: null,
type: 'www',
},
],
plugins: [
sass({
injectGlobalPaths: [
'src/styles/variables.scss',
'src/styles/functions.scss',
'src/styles/mediaqueries.scss',
'src/styles/utilities.scss',
],
}),
],
rollupPlugins: {
before: [eventSync('components')],
},
testing: {
browserHeadless: 'new',
roots: ['<rootDir>/src'],
},
};