Skip to content

Commit

Permalink
build: update rollup config
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed Nov 27, 2024
1 parent 7d46fb9 commit 986734c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 41 deletions.
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@
"test:types-pre": "pnpm run build",
"typecheck": "tsc -p tsconfig.build.json --noEmit"
},
"resolutions": {
"dts-bundle-generator": "9.5.1"
},
"devDependencies": {
"@commitlint/cli": "19.6.0",
"@commitlint/config-conventional": "19.6.0",
Expand Down Expand Up @@ -138,7 +135,7 @@
"rimraf": "6.0.1",
"rollup": "4.27.4",
"rollup-plugin-deassert": "1.3.0",
"rollup-plugin-dts-bundle-generator": "1.4.0",
"rollup-plugin-dts-bundle-generator-2": "1.0.2",
"semantic-release": "24.2.0",
"tsafe": "1.8.5",
"tsc-files": "1.1.4",
Expand Down
27 changes: 8 additions & 19 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 4 additions & 18 deletions rollup.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import rollupPluginTypescript from "@rollup/plugin-typescript";
import type { RollupOptions } from "rollup";
import rollupPluginDeassert from "rollup-plugin-deassert";
import { generateDtsBundle } from "rollup-plugin-dts-bundle-generator";
import generateDtsBundle from "rollup-plugin-dts-bundle-generator-2";

import pkg from "./package.json" with { type: "json" };

Expand All @@ -13,7 +13,6 @@ type PackageJSON = typeof pkg & {
const externalDependencies = [
...Object.keys((pkg as PackageJSON).dependencies ?? {}),
...Object.keys((pkg as PackageJSON).peerDependencies ?? {}),
"tsafe",
];

export default {
Expand All @@ -24,27 +23,11 @@ export default {
file: pkg.exports.import,
format: "esm",
sourcemap: false,
plugins: [
generateDtsBundle({
compilation: {
preferredConfigPath: "tsconfig.build.types.json",
},
outFile: pkg.exports.types.import,
}) as any,
],
},
{
file: pkg.exports.require,
format: "cjs",
sourcemap: false,
plugins: [
generateDtsBundle({
compilation: {
preferredConfigPath: "tsconfig.build.types.json",
},
outFile: pkg.exports.types.require,
}) as any,
],
},
],

Expand All @@ -55,6 +38,9 @@ export default {
rollupPluginDeassert({
include: ["**/*.{js,ts}"],
}),
generateDtsBundle({
preferredConfigPath: "tsconfig.build.types.json",
}),
],

treeshake: {
Expand Down

0 comments on commit 986734c

Please sign in to comment.