Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/deepmergets/rollup.config.ts

Deeply merge 2 or more objects respecting type information.
Go to Latest
File
import rollupPluginReplace from "@rollup/plugin-replace";import { rollupPlugin as rollupPluginDeassert } from "deassert";import { type RollupOptions } from "rollup";import rollupPluginTs from "rollup-plugin-ts";
import p from "./package.json" assert { type: "json" };
const pkg = p as typeof p & { dependencies?: Record<string, string>; peerDependencies?: Record<string, string>;};
const treeshake = { annotations: true, moduleSideEffects: [], propertyReadSideEffects: false, unknownGlobalSideEffects: false,} satisfies RollupOptions["treeshake"];
const library = { input: "src/index.ts",
output: [ { file: pkg.exports.import, format: "esm", sourcemap: false, }, { file: pkg.exports.require, format: "cjs", sourcemap: false, }, ],
external: [ ...Object.keys(pkg.dependencies ?? {}), ...Object.keys(pkg.peerDependencies ?? {}), ],
plugins: [ rollupPluginTs({ transpileOnly: true, tsconfig: "tsconfig.build.json", }), rollupPluginReplace({ values: { "import.meta.vitest": "undefined", }, preventAssignment: true, }), rollupPluginDeassert({ include: ["**/*.{js,ts}"], }), ],
treeshake,} satisfies RollupOptions;
export default [library];