Skip to content

Commit 7c227bb

Browse files
author
John Doe
committed
refactor: base config, cjs compat
1 parent 582e93d commit 7c227bb

File tree

30 files changed

+812
-644
lines changed

30 files changed

+812
-644
lines changed

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default tseslint.config(
2626
enforceBuildableLibDependency: true,
2727
allow: [
2828
String.raw`^.*/eslint(\.base)?\.config\.[cm]?js$`,
29+
String.raw`^.*/tsdown\.base\.[cm]?js$`,
2930
String.raw`^.*/code-pushup\.(config|preset)(\.m?[jt]s)?$`,
3031
'^[./]+/tools/.*$',
3132
],

examples/plugins/tsdown.config.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
import { defineConfig } from 'tsdown';
2+
import { baseConfig, getExternalDependencies } from '../../tsdown.base';
23

3-
// Project name is examples-plugins but directory is examples/plugins
4-
const projectDir = 'examples/plugins';
4+
const __dirname = import.meta.dirname;
55

66
export default defineConfig({
7-
entry: `${projectDir}/src/**/!(*.test|*.spec|*.unit.test|*.int.test|*.e2e.test|*.mock).ts`,
8-
tsconfig: `${projectDir}/tsconfig.lib.json`,
9-
outDir: `${projectDir}/dist/src`, // Output to src/ subdirectory to match tsc
10-
unbundle: true, // Preserve directory structure like tsc
11-
format: ['esm', 'cjs'], // dual build
12-
fixedExtension: true, // emit .mjs for esm and .cjs for cjs
13-
dts: true,
14-
hash: false,
15-
external: [],
16-
exports: false, // manually manage exports via onSuccess
7+
...baseConfig({ projectRoot: __dirname }),
8+
external: await getExternalDependencies(__dirname),
9+
copy: [],
1710
});

0 commit comments

Comments
 (0)