-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
rollup.config2.js
34 lines (32 loc) · 843 Bytes
/
rollup.config2.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
import { resolve } from 'path';
import { monolithConf } from './rollup.common.js';
var sharedInput = './underscore-node-f-pre.js';
var sharedOutput = './underscore-node-f.cjs';
export default [
// ESM entry point for Node.js 12+.
{
input: 'underscore-node-mjs-pre.js',
external: sharedInput,
output: monolithConf({
file: 'underscore-node.mjs',
format: 'esm',
paths: {
[resolve(__dirname, sharedInput)]: sharedOutput,
},
}),
},
// CJS entry point for Node.js 12+, plus code shared with the ESM entry.
{
input: {
'underscore-node-f': sharedInput,
'underscore-node': 'underscore-node-cjs-pre.js',
},
preserveModules: true,
output: monolithConf({
entryFileNames: '[name].cjs',
dir: '.',
exports: 'auto',
format: 'cjs',
}),
},
];