-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
29 lines (27 loc) · 832 Bytes
/
rollup.config.js
File metadata and controls
29 lines (27 loc) · 832 Bytes
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
import resolve from "@rollup/plugin-node-resolve";
import typescript2 from "rollup-plugin-typescript2";
const generalConfig = (moduleSystem) => ({
input: "src/index.ts",
output: {
dir: `dist/${moduleSystem}`,
format: `${moduleSystem}`,
sourcemap: true,
},
external: [],
plugins: [
typescript2({
rootDir: "./",
// using TS2, you must always transpile using ES
// then you can convert afterward to CJS or whatever
// module format you want
tsconfig: `tsconfig.es.json`,
// typescript: require("ttypescript"),
// plugins: [
// { transform: "typescript-transform-paths" },
// { transform: "typescript-transform-paths", afterDeclarations: true },
// ],
}),
resolve(),
],
});
export default [generalConfig("es"), generalConfig("cjs")];