-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
36 lines (35 loc) · 879 Bytes
/
rollup.config.mjs
File metadata and controls
36 lines (35 loc) · 879 Bytes
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
// rollup.config.mjs
import typescript from '@rollup/plugin-typescript'
import { globSync } from 'glob';
import path from 'path';
import { fileURLToPath } from 'url';
export default {
input: Object.fromEntries(
globSync('src/**/!(*.test).ts').map(file => [
path.relative(
'src',
file.slice(0, file.length - path.extname(file).length)
),
fileURLToPath(new URL(file, import.meta.url))
])
),
external: ['events', 'dgram'],
output: [
{
dir: 'dist',
format: 'cjs',
exports: 'named',
strict: false
},
{
dir: 'dist',
format: 'es',
entryFileNames: '[name].mjs',
exports: 'named',
strict: false
}
],
plugins: [
typescript()
]
}