-
Notifications
You must be signed in to change notification settings - Fork 2
/
rollup.config.js
38 lines (35 loc) · 1019 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
// SPDX-FileCopyrightText: 2024 The Forkbomb Company
//
// SPDX-License-Identifier: AGPL-3.0-or-later
import typescript from '@rollup/plugin-typescript';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import copy from 'rollup-plugin-copy';
import path from 'path';
// const uws = 'uws_' + process.platform + '_' + process.arch + '_' + process.versions.modules + '.node';
const uws = 'uws_' + process.platform + '_' + process.arch + '_108.node';
const src = path.join('node_modules', 'uWebSockets.js', uws);
export default {
input: 'src/index.ts',
output: {
file: 'dist/index.cjs',
format: 'cjs',
inlineDynamicImports: true
},
plugins: [
json(),
typescript(),
nodeResolve({
preferBuiltins: true,
exportConditions: ['node']
}),
commonjs({ ignoreDynamicRequires: true }),
copy({
targets: [
{ src: src, dest: 'dist/' },
{ src: './src/openapi.html', dest: 'dist/' }
]
})
]
};