forked from open-feature/js-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.mjs
24 lines (22 loc) · 890 Bytes
/
rollup.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// this config rolls up all the types in the project to a single declaration (d.ts) file.
// we do NOT use rollup to build (we use esbuild for that)
import dts from 'rollup-plugin-dts';
export default {
input: "./src/index.ts",
output: {
file: './dist/types.d.ts',
format: 'es', // module format doesn't really matter here since output is types
},
// function indicating which deps should be considered external: external deps will NOT have their types bundled
external: (id) => {
// bundle everything except peer deps (@openfeature/*, @nest/*, react, rxjs)
return id.startsWith('@openfeature') ||
id.startsWith('@nest') ||
id === 'rxjs' ||
id === 'react';
},
plugins: [
// use the rollup override tsconfig (applies equivalent in each sub-packages as well)
dts({tsconfig: './tsconfig.rollup.json', respectExternal: true }),
],
};