-
Notifications
You must be signed in to change notification settings - Fork 1
/
.rollup.config.types.js
25 lines (22 loc) · 1 KB
/
.rollup.config.types.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
// `rollup` configuration
// ref: <https://devhints.io/rollup>
// v2002-07-14 [rivy]
// setup: `npm i rollup @rollup/plugin-typescript` or `npm i rollup rollup-plugin-typescript2` (for visible TS error output)
// spell-checker:ignore (people) Roy Ivy III * rivy
import dts from 'rollup-plugin-dts';
export default [
// bundle TypeScript typings (TypeScript is unable/unwilling to do so...)
// * ref: <https://github.com/Microsoft/TypeScript/issues/4433> , <https://github.com/google/model-viewer/issues/1502>
// * ref: <https://github.com/Swatinem/rollup-plugin-dts>
{
input: './build/types/src/mod.esm.d.ts',
output: [{ file: './dist/types/mod.d.ts', format: 'esm' }],
plugins: [dts()],
},
{
input: './build/types/src/mod.cjs.d.ts',
output: [{ file: './dist/types/mod.cjs.d.ts', format: 'cjs' }],
plugins: [dts()],
// * note: for correct interpretation of types by VSCode, './dist/types/mod.cjs.d.ts' requires a subsequent text replacement ("export { _default as default }" => "export = _default")
},
];