-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
34 lines (33 loc) · 1.06 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
// derived from: https://github.com/rollup/rollup-starter-lib/blob/master/rollup.config.js
import { nodeResolve } from "@rollup/plugin-node-resolve";
import nodePolyfills from "rollup-plugin-polyfill-node";
import commonjs from "@rollup/plugin-commonjs";
import pkg from "./package.json" assert { type: "json" };
export default [
{
// Note: it is faster to generate multiple builds from the same config
// where possible
// name: pkg.name,
input: "src/main.js",
external: ["crypto"],
output: [
{
// inlineDynamicImports: true,
file: pkg.module,
format: "es",
// sourcemap: true,
exports: "named",
interop: "compat",
},
],
plugins: [
// json(),
// nodePolyfils so import fs works in node and in browser, on node it is stubbed to the global
// This needs preferBuiltins to be false in the nodeResolve plugin
nodePolyfills(),
nodeResolve({ preferBuiltins: true }),
commonjs(),
],
// plugins: [json(), resolve(), nodePolyfills(), commonjs()],
},
];