2021-01-16 22:49:52 +01:00
|
|
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
|
|
|
import commonJS from "@rollup/plugin-commonjs";
|
2021-01-17 22:49:21 +01:00
|
|
|
import virtual from "@rollup/plugin-virtual";
|
|
|
|
import replace from "@rollup/plugin-replace";
|
|
|
|
import visualizer from "rollup-plugin-visualizer";
|
2021-01-16 22:49:52 +01:00
|
|
|
|
2021-01-17 22:49:21 +01:00
|
|
|
const empty = "export default {}";
|
2020-07-11 10:31:52 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
input: "main.js",
|
|
|
|
output: {
|
|
|
|
file: "build/snarkjs.js",
|
|
|
|
format: "iife",
|
|
|
|
sourcemap: "inline",
|
|
|
|
globals: {
|
|
|
|
os: "null"
|
|
|
|
},
|
|
|
|
name: "snarkjs"
|
|
|
|
},
|
|
|
|
plugins: [
|
2021-01-16 22:49:52 +01:00
|
|
|
virtual({
|
|
|
|
fs: empty,
|
|
|
|
os: empty,
|
|
|
|
crypto: empty,
|
|
|
|
readline: empty,
|
|
|
|
worker_threads: empty,
|
|
|
|
}),
|
|
|
|
nodeResolve(),
|
2020-07-11 10:31:52 +02:00
|
|
|
commonJS(),
|
|
|
|
replace({ "process.browser": !!process.env.BROWSER }),
|
2021-01-17 22:49:21 +01:00
|
|
|
visualizer(),
|
2020-07-11 10:31:52 +02:00
|
|
|
]
|
|
|
|
};
|