-
Notifications
You must be signed in to change notification settings - Fork 178
/
dts.config.cjs
41 lines (36 loc) · 1.15 KB
/
dts.config.cjs
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
const packageJson = require("./package.json");
const getPackageName = () => {
return (packageJson.name.includes('@') ? packageJson.name.split('/')[1] : packageJson.name).replace('.', '-');
};
const components = ['alert', 'button', 'carousel', 'collapse', 'dropdown', 'modal', 'offcanvas', 'popover', 'scrollspy', 'tab', 'toast', 'tooltip'];
/** @param {string} component */
const componentName = (component) => {
if (component === 'scrollspy') return 'ScrollSpy';
return component[0].toUpperCase() + component.slice(1);
}
const config = {
compilationOptions: {
preferredConfigPath: './tsconfig.json',
},
entries: [
{
filePath: "src/index.ts",
outFile: `dist/${getPackageName()}.d.ts`,
// noCheck: false,
output: {
umdModuleName: 'BSN',
noBanner: true,
}
},
...components.map((component) => ({
filePath: `src/components/${component}.ts`,
outFile: `dist/components/${component}.d.ts`,
noCheck: false,
output: {
umdModuleName: componentName(component),
noBanner: true,
}
})),
],
};
module.exports = config;