-
Notifications
You must be signed in to change notification settings - Fork 43
/
rollup.config.js
30 lines (29 loc) · 1.1 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
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import { defineConfig } from 'rollup';
export default defineConfig({
input: 'bin/rdme.js',
output: { file: 'dist/rollup-output.cjs', format: 'cjs', inlineDynamicImports: true },
plugins: [
commonjs(),
json(),
nodeResolve({
// see here: https://github.com/rollup/plugins/tree/master/packages/node-resolve#exportconditions
// this is required to get chalk working properly
exportConditions: ['node'],
preferBuiltins: true,
}),
// this disgusting workaround is required to prevent runtime errors,
// see https://github.com/JS-DevTools/ono/issues/19
replace({
delimiters: ['', ''],
preventAssignment: true,
values: {
'if (typeof module === "object" && typeof module.exports === "object") {':
'if (typeof module === "object" && typeof module.exports === "object" && typeof module.exports.default === "object") {',
},
}),
],
});