Christian Galo be9f5bc20c
Some checks failed
CI / build (20.x) (push) Has been cancelled
CI / build (22.x) (push) Has been cancelled
from template npm create wiki-plugin@latest FarmManager
2025-06-08 15:47:58 -05:00

23 lines
633 B
JavaScript

import * as esbuild from 'esbuild'
import fs from 'node:fs/promises'
import packJSON from '../package.json' with { type: 'json' }
const version = packJSON.version
const now = new Date()
let results = await esbuild.build({
entryPoints: ['src/client/farmmanager.js'],
bundle: true,
banner: {
js: `/* wiki-plugin-farmmanager - ${version} - ${now.toUTCString()} */`,
},
minify: true,
sourcemap: true,
logLevel: 'info',
metafile: true,
outfile: 'client/farmmanager.js',
})
await fs.writeFile('meta-client.json', JSON.stringify(results.metafile))
console.log("\n esbuild metadata written to 'meta-client.json'.")