-
Notifications
You must be signed in to change notification settings - Fork 2
/
rollup.config.js
81 lines (79 loc) · 1.82 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import typescript from '@rollup/plugin-typescript'
import { globSync } from 'glob'
import path from 'path'
import { defineConfig } from 'rollup'
import { fileURLToPath } from 'url'
const inputs = Object.fromEntries(
globSync('src/**/*.{ts,js,tsx}', { ignore: '**/*.d.ts' }).map((file) => [
// This remove `src/` as well as the file extension from each
// file, so e.g. src/nested/foo.js becomes nested/foo
path.relative('src', file.slice(0, file.length - path.extname(file).length)),
// This expands the relative paths to absolute paths, so e.g.
// src/nested/foo becomes /project/src/nested/foo.js
fileURLToPath(new URL(file, import.meta.url)),
])
)
export default defineConfig({
input: inputs,
output: {
dir: './build',
format: 'es',
sourcemap: true,
// chunkFileNames: '[name].js',
preserveModules: true,
preserveModulesRoot: 'src',
// compact: true,
},
plugins: [
typescript({
tslib: './src/tslib.es6.js',
}),
],
cache: true,
external: [
'async-mqtt',
'commander',
'compression',
'connect-flash',
'connect-typeorm',
'cookie-parser',
'crypto',
'csrf-csrf',
'debug',
'dotenv-flow/config',
'escape-html',
'express-async-errors',
'express-session',
'express-static-gzip',
'express',
'file-type',
'formidable',
'fs',
'glob',
'lodash',
'luxon',
'morgan',
'newrelic',
'node-hgt',
'node:child_process',
'node:crypto',
'nodemailer',
'os',
'p-queue',
'p-retry',
'passport-google-oauth20',
'passport-google-one-tap',
'passport-magic-login',
'passport',
'path',
'pg-boss',
'pg-connection-string',
'pluralize',
'protobufjs/minimal.js',
'reflect-metadata',
'response-time',
'typeorm',
'url',
'uuid',
],
})