mirror of
https://github.com/unraid/api.git
synced 2026-02-17 21:48:34 -06:00
31 lines
738 B
TypeScript
31 lines
738 B
TypeScript
import { execSync } from 'child_process';
|
|
import 'dotenv/config';
|
|
import { defineConfig } from 'tsup';
|
|
import { version } from './package.json';
|
|
import getTags from './scripts/get-tags.mjs'
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
name: 'tsup',
|
|
target: 'node18',
|
|
entry: {
|
|
'unraid-api': 'src/cli.ts',
|
|
index: 'src/index.ts',
|
|
},
|
|
metafile: true,
|
|
splitting: false,
|
|
sourcemap: true,
|
|
clean: true,
|
|
external: ['@vmngr/libvirt'],
|
|
esbuildOptions(options) {
|
|
if (!options.define) options.define = {};
|
|
|
|
const tags = getTags(process.env);
|
|
|
|
options.define['process.env.VERSION'] = tags.isTagged
|
|
? `"${version}"`
|
|
: `"${version}+${tags.shortSha}"`;
|
|
},
|
|
});
|