-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.mjs
41 lines (38 loc) · 1.12 KB
/
rollup.config.mjs
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
import typescript from '@rollup/plugin-typescript';
import replace from '@rollup/plugin-replace';
import terser from '@rollup/plugin-terser';
function getConfig() {
const isDevelopment = !!process.env.ROLLUP_WATCH;
const fileName = isDevelopment ? 'sudoku-multi-solver.development' : 'sudoku-multi-solver';
return {
input: './src/index.ts',
external: ['msgpack5', 'fs/promises'],
plugins: [
replace({
preventAssignment: true,
values: {
__DEVELOPMENT__: isDevelopment,
},
}),
typescript({
tsconfig: './tsconfig.json',
sourceMap: false,
outputToFilesystem: true,
}),
terser(),
],
output: [
{
file: `./lib/${fileName}.mjs`,
format: 'esm',
exports: 'auto',
},
{
file: `./lib/${fileName}.js`,
format: 'cjs',
exports: 'auto',
},
],
};
}
export default [getConfig()];