Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ function basePlugins(options: {
];
}

// The root tsconfig inherits `declaration: true` (library profile). Only the
// `modules` build is meant to emit declarations (into dist/esm); every other
// config must switch them off, or @rollup/plugin-typescript emits the whole
// .d.ts tree as bundle assets — polluting dist/ with a duplicate declaration
// tree and inflating the Codecov bundle-analysis numbers (incompressible
// assets are counted at raw size in the gzip column).
const noDeclarations = { declaration: false, declarationMap: false } as const;

const bundled: RollupOptions = {
input: 'src/index.ts',
output: {
Expand All @@ -132,7 +140,7 @@ const bundled: RollupOptions = {
...basePlugins({
exportConditions: sourceConditions,
transform: typescript({
compilerOptions: { incremental: false },
compilerOptions: { incremental: false, ...noDeclarations },
outputToFilesystem: false,
}),
minify: 'production',
Expand All @@ -153,7 +161,7 @@ const iife: RollupOptions = {
plugins: basePlugins({
exportConditions: sourceConditions,
transform: typescript({
compilerOptions: { incremental: false },
compilerOptions: { incremental: false, ...noDeclarations },
outputToFilesystem: false,
}),
}),
Expand All @@ -172,7 +180,7 @@ const iifeMin: RollupOptions = {
...basePlugins({
exportConditions: sourceConditions,
transform: typescript({
compilerOptions: { incremental: false },
compilerOptions: { incremental: false, ...noDeclarations },
outputToFilesystem: false,
}),
minify: 'always',
Expand All @@ -197,7 +205,7 @@ const debugBundled: RollupOptions = {
plugins: basePlugins({
exportConditions: sourceConditions,
transform: typescript({
compilerOptions: { incremental: false },
compilerOptions: { incremental: false, ...noDeclarations },
outputToFilesystem: false,
}),
minify: 'production',
Expand Down
Loading