d3a18fbdf6
* fix: otlp-importer script * update pluginPath * Refactor script to ensure compatibility with both Windows and Unix platforms * Revert command changes * Fix: Init command was failing on Windows because of bad template paths * Removed resolveInternalFilePath * Path fixes for the dev command * Fix for the import paths being wrong on Windows because the contain backslashes * The metaOutputKey should have forward slashes in it * Print the banner immediately, otherwise with bad internet you get a blank console for a long time * Try normalizing the trigger.config import path * Allow tsx and jsx files * Improved task file names and paths * Removed closing bracket for the upgrade message * Log out the metafile outputs for debugging * Log out the entryPointContents before esbuild * Log the metafile out * ballmerize the cli * replace npm-watch with plain old nodemon * fix text inputs on windows * changeset --------- Co-authored-by: Kritik Jiyaviya <kritikjiyaviya07@gmail.com> Co-authored-by: Matt Aitken <matt@mattaitken.com>
31 lines
828 B
TypeScript
31 lines
828 B
TypeScript
import { cp } from "fs/promises";
|
|
import { join } from "path";
|
|
import { defineConfig } from "tsup";
|
|
|
|
const isDev = process.env.npm_lifecycle_event === "dev:main"; // This must match the npm script name
|
|
|
|
export default defineConfig({
|
|
clean: false,
|
|
tsconfig: "tsconfig.json",
|
|
dts: true,
|
|
splitting: false,
|
|
entry: ["src/index.ts"],
|
|
format: ["esm"],
|
|
minify: false,
|
|
metafile: false,
|
|
sourcemap: true,
|
|
target: "esnext",
|
|
outDir: "dist",
|
|
async onSuccess() {
|
|
if (isDev) {
|
|
console.debug("Running onSuccess() in dev");
|
|
// exec: node dist/index.js
|
|
}
|
|
|
|
await cp(join("src", "templates"), "dist/templates", { recursive: true });
|
|
},
|
|
banner: {
|
|
js: "import { createRequire as createRequireFromMetaUrl } from 'node:module';const require = createRequireFromMetaUrl(import.meta.url);",
|
|
},
|
|
});
|