mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-11 16:48:27 +00:00
27 lines
685 B
TypeScript
27 lines
685 B
TypeScript
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
|
|
}
|
|
},
|
|
banner: {
|
|
js: "import { createRequire as createRequireFromMetaUrl } from 'node:module';const require = createRequireFromMetaUrl(import.meta.url);",
|
|
},
|
|
});
|