This commit is contained in:
7
packages/tsup-config/.oxlintrc.json
Normal file
7
packages/tsup-config/.oxlintrc.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ignorePatterns": ["node_modules", "dist", ".turbo"],
|
||||
"extends": [
|
||||
"../oxlint-config/index.jsonc"
|
||||
// "@monkeytype/oxlint-config"
|
||||
]
|
||||
}
|
||||
27
packages/tsup-config/package.json
Normal file
27
packages/tsup-config/package.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "@monkeytype/tsup-config",
|
||||
"private": true,
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./src/index.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "tsup-node --watch",
|
||||
"build": "tsup-node",
|
||||
"ts-check": "tsc --noEmit",
|
||||
"lint": "oxlint . --type-aware --type-check",
|
||||
"lint-fast": "oxlint ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@monkeytype/typescript-config": "workspace:*",
|
||||
"oxlint": "1.60.0",
|
||||
"oxlint-tsgolint": "0.21.0",
|
||||
"typescript": "6.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tsup": "8.4.0"
|
||||
}
|
||||
}
|
||||
21
packages/tsup-config/src/index.ts
Normal file
21
packages/tsup-config/src/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { defineConfig, Options } from "tsup";
|
||||
|
||||
export function extendConfig(
|
||||
customizer?: (options: Options) => Options,
|
||||
): (options: Options) => unknown {
|
||||
return (options) => {
|
||||
const overrideOptions = customizer?.(options);
|
||||
const config: Options = {
|
||||
entry: ["src/**/*.ts"],
|
||||
splitting: false,
|
||||
sourcemap: true,
|
||||
clean: !(options.watch === true || options.watch === "true"),
|
||||
format: ["cjs", "esm"],
|
||||
dts: false,
|
||||
minify: true,
|
||||
...overrideOptions,
|
||||
};
|
||||
|
||||
return defineConfig(config);
|
||||
};
|
||||
}
|
||||
13
packages/tsup-config/tsconfig.json
Normal file
13
packages/tsup-config/tsconfig.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"extends": "@monkeytype/typescript-config/base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"moduleResolution": "NodeNext",
|
||||
"module": "NodeNext",
|
||||
"target": "ES2015",
|
||||
"lib": ["es2016"]
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
10
packages/tsup-config/tsup.config.js
Normal file
10
packages/tsup-config/tsup.config.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import { defineConfig } from "tsup";
|
||||
|
||||
export default defineConfig((_options) => ({
|
||||
entry: ["src/index.ts"],
|
||||
splitting: false,
|
||||
sourcemap: false,
|
||||
clear: !_options?.watch,
|
||||
format: ["cjs", "esm"],
|
||||
dts: false,
|
||||
}));
|
||||
Reference in New Issue
Block a user