-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
47 lines (43 loc) · 1.14 KB
/
rollup.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
40
41
42
43
44
45
46
47
import { readFileSync } from "fs";
import ts from "rollup-plugin-typescript2";
import resolve from "rollup-plugin-node-resolve";
import commonJS from "rollup-plugin-commonjs";
const pkg = JSON.parse(readFileSync("package.json", "utf-8"));
function output(config, format, opts = {}) {
return {
input: `src/${pkg.name}.ts`,
output: { ...{ file: `dist/${config}/${pkg.name}.js`, format }, ...opts },
plugins: [
resolve(),
commonJS({
include: "node_modules/**"
}),
ts({
tsconfig: `configs/tsconfig-build-${config}.json`,
tsconfigOverride: {
compilerOptions: {
module: "ES2015"
}
},
cacheRoot: ".rollupcache"
})
],
external: [
"aurelia-binding",
"aurelia-dependency-injection",
"aurelia-logging",
"aurelia-pal",
"aurelia-task-queue",
"aurelia-templating"
]
};
}
const outputs = [
output("amd", "amd", { amd: { id: pkg.name } }),
output("commonjs", "cjs"),
output("es2017", "es"),
output("es2015", "es"),
output("native-modules", "es"),
output("system", "system")
];
export default outputs;