forked from htmlstreamofficial/preline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdts-config.js
39 lines (34 loc) · 789 Bytes
/
dts-config.js
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
const fs = require('fs');
const pluginsDir = './src/plugins';
const distDir = './dist';
const excludePlugins = ['base-plugin'];
const outputConfig = { noBanner: true };
const config = {
compilationOptions: {
preferredConfigPath: './tsconfig.json',
},
entries: [
{
filePath: './src/index.ts',
outFile: './dist/index.d.ts',
output: outputConfig,
},
...fs
.readdirSync(pluginsDir)
.map((pluginName) => {
if (
!fs.lstatSync(`${pluginsDir}/${pluginName}`).isDirectory() ||
excludePlugins.includes(pluginName)
) {
return null;
}
return {
filePath: `${pluginsDir}/${pluginName}/index.ts`,
outFile: `${distDir}/${pluginName}.d.ts`,
output: outputConfig,
};
})
.filter(Boolean),
],
};
module.exports = config;