forked from RocketChat/fuselage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
43 lines (40 loc) · 899 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
33
34
35
36
37
38
39
40
41
42
43
const path = require('path');
const commonjs = require('@rollup/plugin-commonjs');
const resolve = require('@rollup/plugin-node-resolve');
const typescript = require('@rollup/plugin-typescript').default;
const pkg = require('./package.json');
/** @type {import('rollup').RollupOptions[]} */
module.exports = [
{
input: 'src/index.ts',
output: {
dir: path.dirname(pkg.main),
entryFileNames: path.basename(pkg.main),
format: 'cjs',
sourcemap: true,
strict: false,
},
plugins: [
typescript({
tsconfig: 'tsconfig.build.json',
}),
resolve(),
commonjs(),
],
},
{
input: 'src/index.ts',
output: {
file: pkg.module,
format: 'esm',
sourcemap: true,
},
plugins: [
typescript({
tsconfig: 'tsconfig.build.json',
}),
resolve(),
commonjs(),
],
},
];