forked from visa/visa-chart-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstencil.config.ts
64 lines (62 loc) · 2.08 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
/**
* Copyright (c) 2020, 2021, 2022, 2023 Visa, Inc.
*
* This source code is licensed under the MIT license
* https://github.com/visa/visa-chart-components/blob/master/LICENSE
*
**/
import { Config } from '@stencil/core';
import { sass } from '@stencil/sass';
import { esModules } from '../utils-dev/src/utils-dev/unit-test-utils';
// exclude nested components from output targets, their packages will
// send the components to output targets as needed.
// const excludeComponents = ['data-table', 'keyboard-instructions'];
// @ts-ignore
const dev: boolean = process.argv && process.argv.indexOf('--dev') > -1;
export const config: Config | any = {
namespace: 'bar-chart',
tsconfig: dev ? './tsconfig.dev.json' : './tsconfig.prod.json',
buildEs5: 'prod',
extras: {
cssVarsShim: true,
dynamicImportShim: true,
safari10: true,
shadowDomShim: true,
scriptDataOpts: true,
appendChildSlotFix: false,
cloneNodeFix: false,
slotChildNodesFix: true
},
outputTargets: [
{ type: 'dist' },
{
// we also use this output to copy the source code to our bundle package at @visa/charts
type: 'www',
copy: [
{ src: 'components/bar-chart', dest: '../../charts/src/components/bar-chart', warn: true },
{ src: 'scss', dest: '../../charts/scss', warn: true }
]
}
],
plugins: [
sass({
injectGlobalPaths: ['src/scss/objects.scss']
})
],
commonjs: {
include: ['../utils/dist/visa-charts-utils.umd.js']
},
testing: {
reporters: ['default', '../../node_modules/jest-html-reporter'],
transform: {
'^.+\\.(ts|tsx|js|jsx|css)$': '@stencil/core/testing/jest-preprocessor'
},
transformIgnorePatterns: [`/node_modules/(?!${esModules})`]
// another option for how to handle this, use d3's pre-minified files as well
// however transpiling is preferred and should be more stable in the long run
// moduleNameMapper: {
// "^d3-color$": "<rootDir>/node_modules/d3-color/dist/d3-color.min.js",
// "^d3-scale$": "<rootDir>/node_modules/d3-scale/dist/d3-scale.min.js"
// }
}
};