-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
rollup.config.ts
59 lines (54 loc) · 1.33 KB
/
rollup.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
import { exec } from "child_process";
import lodash from "lodash";
import typescript from "@rollup/plugin-typescript";
import dts from "rollup-plugin-dts";
const tsconfig = "tsconfig.build.json";
const tscAlias = () => {
return {
name: "tsAlias",
buildStart: () => {
return new Promise((resolve, reject) => {
exec(
`tsc-alias -p ${tsconfig}`,
function callback(error, stdout, stderr) {
if (stderr || error) {
reject(stderr || error);
} else {
resolve(stdout);
}
},
);
});
},
};
};
const libraryName = "metar-taf-parser";
export default [
{
input: {
"metar-taf-parser": "src/index.ts",
"locale/en": "src/locale/en.ts",
"locale/de": "src/locale/de.ts",
"locale/fr": "src/locale/fr.ts",
"locale/it": "src/locale/it.ts",
"locale/pl": "src/locale/pl.ts",
"locale/zh-CN": "src/locale/zh-CN.ts",
},
output: [
{
dir: "dist",
name: lodash.camelCase(libraryName),
format: "es",
},
],
watch: {
include: "src/**",
},
plugins: [typescript({ tsconfig }), tscAlias()],
},
{
input: "./dist/index.d.ts",
output: [{ file: "metar-taf-parser.d.ts", format: "es" }],
plugins: [tscAlias(), dts()],
},
];