Project setup

This commit is contained in:
Julien Valverdé
2024-01-28 18:00:39 +01:00
parent abb2774977
commit 44c913a05a
15 changed files with 672 additions and 2 deletions

34
rollup.config.ts Normal file
View File

@@ -0,0 +1,34 @@
import { nodeResolve } from "@rollup/plugin-node-resolve"
import { defineConfig } from "rollup"
import cleanup from "rollup-plugin-cleanup"
import ts from "rollup-plugin-ts"
import pkg from "./package.json" assert { type: "json" }
export default defineConfig({
input: "src/index.ts",
output: [
{
file: pkg.exports["."].import.default,
format: "esm",
},
{
file: pkg.exports["."].require.default,
format: "cjs",
},
],
external: id => !/^[./]/.test(id),
plugins: [
nodeResolve(),
ts(),
cleanup({
comments: "jsdoc",
extensions: ["ts"],
}),
],
})