forked from fisker/left-phalange-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
45 lines (41 loc) · 1.02 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
/* eslint-disable */
import cjs from '@rollup/plugin-commonjs';
import nodePolyfills from 'rollup-plugin-node-polyfills';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import packageJson from './package.json' with {type: "json"};;
const {dependencies} = packageJson;
const plugins = [cjs()];
const external = [`path`, `fs`, `fs/promises`, ...Object.keys(dependencies)];
export default [
{
input: `src/index.js`,
output: [
{
file: `dist/index.cjs`,
format: `cjs`,
},
],
external,
plugins,
},
{
input: `src/browser.js`,
output: [
{
file: `dist/browser.es.js`,
format: `esm`,
},
],
plugins: [nodeResolve({browser: true, preferBuiltins: false}), ...plugins, nodePolyfills()],
},
{
input: `src/deno.js`,
output: [
{
file: `dist/deno.es.js`,
format: `esm`,
},
],
plugins: [nodeResolve({browser: true, preferBuiltins: false}), ...plugins, nodePolyfills()],
},
];