-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrollup.config.js
44 lines (42 loc) · 965 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
44
import resolve from '@rollup/plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2';
import pkg from './package.json' assert { type: 'json' };
const external = Object.keys(pkg.dependencies).concat([
'events',
'http',
'zlib',
'fs'
]);
export default ['nanoexpress'].map((name) => ({
input: `./src/${name}.ts`,
output: [
{
format: 'esm',
file: `./esm/${name}.js`,
strict: true,
sourcemap: true,
exports: 'auto'
},
{
format: 'cjs',
file: `./cjs/${name}.cjs`,
strict: true,
sourcemap: true,
exports: 'auto'
}
],
plugins: [
resolve({ extensions: ['.ts', '.d.ts'] }),
typescript({
rollupCommonJSResolveHack: false,
clean: true,
tsconfigOverride: {
include: ['src'],
exclude: ['examples', 'utils'],
compilerOptions: { rootDir: 'src' }
},
useTsconfigDeclarationDir: true
})
],
external
}));