-
Notifications
You must be signed in to change notification settings - Fork 169
/
Copy pathrollup.config.js
27 lines (26 loc) · 1.09 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
import typescript from '@rollup/plugin-typescript';
import pjson from '@rollup/plugin-json';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import dts from 'rollup-plugin-dts';
export default [
{
// server build non-transpiled with es2015 modules
input: 'src/package/serverExports.ts',
external: ['fs', 'bufferutil', 'utf-8-validate'],
output: { file: 'dist/server/lance-gg.js', format: 'esm', name: 'Server' },
plugins: [resolve(), typescript(), pjson(), commonjs({ include: 'node_modules/**' })]
},
{
// client build non-transpiled with es2015 modules
input: 'src/package/clientExports.ts',
output: { file: 'dist/client/lance-gg.js', format: 'esm', name: 'Client' },
plugins: [resolve({ browser: true, preferBuiltins: false }), typescript(), pjson(), commonjs({ include: 'node_modules/**' })]
},
{
// types only
input: ['src/package/allExports.ts'],
output: { file: "dist/types/lance-gg.d.ts", format: "es" },
plugins: [dts()]
}
]