-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.mjs
39 lines (38 loc) · 988 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import json from '@rollup/plugin-json';
import typescript from '@rollup/plugin-typescript';
/**
* @type {import('rollup').RollupOptions[]}
*/
const config = [
{
input: 'src/index.ts',
output: [
{
sourcemap: 'inline',
file: 'dist/main.cjs',
format: 'cjs',
},
{
sourcemap: 'inline',
file: 'dist/main.mjs',
format: 'es',
},
],
plugins: [typescript({ sourceMap: true, inlineSources: true, tsconfig: './tsconfig.json' })],
external: ['testcafe'],
},
{
input: 'tests/index.ts',
output: [
{
sourcemap: 'inline',
file: 'tests/index.mjs',
format: 'es',
externalImportAttributes: true,
},
],
plugins: [typescript({ sourceMap: true, inlineSources: true, tsconfig: 'tests/tsconfig.json' }), json()],
external: ['node:assert/strict', 'node:assert', 'node:test', 'node:child_process', 'node:fs/promises'],
},
];
export default config;