-
-
Notifications
You must be signed in to change notification settings - Fork 77
/
rollup.config.js
32 lines (31 loc) · 931 Bytes
/
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
import path from "path";
import typescript from "rollup-plugin-typescript2";
import commonjs from "rollup-plugin-commonjs";
import pkg from "./package.json";
export default {
external(id) {
return Object.keys(pkg.dependencies).includes(id) || id.startsWith("dayjs")
},
input: "./src/index.ts",
output: {
file: path.resolve(__dirname, "dist", "esm", "index.esm.js"),
format: "esm",
paths: {
dayjs: "dayjs/esm",
"dayjs/plugin/customParseFormat": "dayjs/esm/plugin/customParseFormat",
},
},
plugins: [
typescript({
check: false,
rollupCommonJSResolveHack: true,
tsconfigOverride: {
compilerOptions: {
module: "es2015",
declaration: false,
},
},
}),
commonjs({extensions: [ ".js", ".ts" ]}),
],
};