This repository has been archived on 2023-04-04. You can view files and clone it, but cannot push or open issues or pull requests.
webcrypto/rollup.config.mjs

45 lines
817 B
JavaScript
Raw Normal View History

import typescript from "rollup-plugin-typescript2";
2022-11-02 10:24:33 +00:00
import pkg from "./package.json" assert { type: "json" };
2019-01-25 10:43:13 +00:00
const banner = [
2022-03-02 18:35:31 +00:00
"/*!",
" Copyright (c) Peculiar Ventures, LLC",
"*/",
"",
].join("\n");
const input = "src/index.ts";
2022-03-02 18:35:31 +00:00
const external = [
...["crypto", "process"],
...Object.keys(pkg.dependencies || {}),
];
2019-01-25 10:43:13 +00:00
2022-03-02 18:35:31 +00:00
export default [
{
input,
plugins: [
typescript({
check: true,
clean: true,
tsconfigOverride: {
compilerOptions: {
module: "ES2015",
removeComments: true,
}
2019-01-25 10:43:13 +00:00
}
2022-03-02 18:35:31 +00:00
}),
],
external: [...external],
output: [
{
banner,
file: pkg.main,
format: "cjs",
},
{
banner,
file: pkg.module,
format: "es",
},
],
},
];