mirror of
https://github.com/tornadocash/snarkjs.git
synced 2024-11-01 07:45:43 +01:00
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
|
import commonJS from "@rollup/plugin-commonjs";
|
|
import virtual from "@rollup/plugin-virtual";
|
|
import replace from "@rollup/plugin-replace";
|
|
import visualizer from "rollup-plugin-visualizer";
|
|
|
|
const empty = "export default {}";
|
|
|
|
export default {
|
|
input: "main.js",
|
|
output: {
|
|
file: "build/snarkjs.js",
|
|
format: "iife",
|
|
sourcemap: "inline",
|
|
globals: {
|
|
os: "null"
|
|
},
|
|
name: "snarkjs"
|
|
},
|
|
plugins: [
|
|
virtual({
|
|
fs: empty,
|
|
os: empty,
|
|
crypto: empty,
|
|
readline: empty,
|
|
ejs: empty,
|
|
}),
|
|
nodeResolve({
|
|
browser: true,
|
|
preferBuiltins: false,
|
|
exportConditions: ['browser', 'default', 'module', 'require']
|
|
}),
|
|
commonJS(),
|
|
replace({
|
|
// The current default is false, but they are changing it next version
|
|
preventAssignment: false,
|
|
"process.browser": !!process.env.BROWSER
|
|
}),
|
|
visualizer(),
|
|
]
|
|
};
|