fp/services/mailbox/tsup.config.js

39 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-07-23 02:59:41 +00:00
import { defineConfig } from "tsup"
import { exec } from 'node:child_process'
export default defineConfig({
entry: [
"src/index.ts",
"src/tasks/**.ts"
],
/**
* lots of compatibility issues outputting to ESM. So we output to CJS to get things working.
*/
format: ["cjs"],
target: "es2022",
sourcemap: true,
/**
* The common package is using the internal packages approach, so it needs to
* be transpiled / bundled together with the deployed code.
*/
noExternal: [
"@futureporn/image",
"@futureporn/utils",
"@futureporn/scout",
"@futureporn/storage",
"@futureporn/types",
],
/**
* Do not use tsup for generating d.ts files because it can not generate type
* the definition maps required for go-to-definition to work in our IDE. We
* use tsc for that.
*/
splitting: false,
treeshake: true,
clean: true,
outDir: 'dist', // Where you want your compiled files to live
shims: true,
onSuccess: async () => {
exec('tsc --emitDeclarationOnly');
}
});