mirror of
https://github.com/semaphore-protocol/semaphore.git
synced 2026-01-08 22:28:08 -05:00
30 lines
855 B
TypeScript
30 lines
855 B
TypeScript
import typescript from "rollup-plugin-typescript2"
|
|
import * as fs from "fs"
|
|
import cleanup from "rollup-plugin-cleanup"
|
|
|
|
const pkg = JSON.parse(fs.readFileSync("./package.json", "utf-8"))
|
|
const banner = `/**
|
|
* @module ${pkg.name}
|
|
* @version ${pkg.version}
|
|
* @file ${pkg.description}
|
|
* @copyright Ethereum Foundation 2024
|
|
* @license ${pkg.license}
|
|
* @see [Github]{@link ${pkg.homepage}}
|
|
*/`
|
|
|
|
export default {
|
|
input: "src/index.ts",
|
|
output: [
|
|
{ file: pkg.exports.require, format: "cjs", banner, exports: "auto" },
|
|
{ file: pkg.exports.default, format: "es", banner }
|
|
],
|
|
external: [...Object.keys(pkg.dependencies), "hardhat/config"],
|
|
plugins: [
|
|
typescript({
|
|
tsconfig: "./build.tsconfig.json",
|
|
useTsconfigDeclarationDir: true
|
|
}),
|
|
cleanup({ comments: "jsdoc" })
|
|
]
|
|
}
|