-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstencil.config.ts
More file actions
67 lines (64 loc) · 2.15 KB
/
stencil.config.ts
File metadata and controls
67 lines (64 loc) · 2.15 KB
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
import { Config } from '@stencil/core';
import { sass } from '@stencil/sass';
import { reactOutputTarget } from '@stencil/react-output-target';
import { vueOutputTarget } from '@stencil/vue-output-target';
import nodePolyfills from 'rollup-plugin-node-polyfills';
import tailwind from 'stencil-tailwind-plugin';
import { getExcludedComponentTags } from './src/global/scripts/exclude-react-components';
import image from '@rollup/plugin-image';
/**
* A list of component tags to be excluded from the build process.
*
* This is necessary to exclude functional components (components used by `sdk-dapp`)
* in order to prevent potential conflicts with the event bus and issues related to
* Stencil's state management. By excluding these components, we ensure that the
* application remains stable and avoids unintended behavior caused by overlapping
* event handling or state inconsistencies.
*
* The components to be excluded are determined dynamically from the specified directory.
*/
const excludeComponents = getExcludedComponentTags('./src/components/functional');
const isDev = process.argv.includes('--dev');
export const config: Config = {
namespace: 'sdk-dapp-ui',
globalStyle: './src/global/style.css',
buildEs5: false,
plugins: [
sass(),
tailwind({
tailwindCssPath: './src/global/tailwind.css',
}),
],
sourceMap: isDev,
testing: {
setupFilesAfterEnv: ['./src/setupTests.ts'],
},
outputTargets: [
reactOutputTarget({
outDir: './dist/react',
stencilPackageName: '../../dist/types',
customElementsDir: '../web-components',
excludeComponents,
}),
vueOutputTarget({
componentCorePackage: '../../dist/types',
proxiesFile: './dist/vue/components.ts',
customElementsDir: '../web-components',
excludeComponents,
}),
{
type: 'dist-custom-elements',
externalRuntime: false,
generateTypeDeclarations: true,
customElementsExportBehavior: 'bundle',
dir: './dist/web-components',
copy: [{ src: 'assets', dest: 'dist/assets' }],
},
],
rollupPlugins: {
before: [nodePolyfills(), image()],
},
extras: {
enableImportInjection: true,
},
};