snarkjs/config/rollup.iife_min.config.js

37 lines
853 B
JavaScript
Raw Normal View History

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';
2020-07-13 07:21:03 +02:00
import { terser } from "rollup-plugin-terser";
const empty = 'export default {}';
2020-07-13 07:21:03 +02:00
export default {
input: "main.js",
output: {
file: "build/snarkjs.min.js",
format: "iife",
globals: {
os: "null"
},
name: "snarkjs"
},
plugins: [
virtual({
fs: empty,
os: empty,
crypto: empty,
readline: empty,
worker_threads: empty,
}),
nodeResolve({
browser: true
}),
2020-07-13 07:21:03 +02:00
commonJS(),
replace({
"process.browser": !!process.env.BROWSER
}),
2020-07-13 07:21:03 +02:00
terser()
]
};