ニジカ投稿局 https://tv.nizika.tv
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

28 lines
792 B

  1. import * as esbuild from 'esbuild'
  2. import { readFileSync } from 'fs'
  3. const packageJSON = JSON.parse(readFileSync(new URL('../package.json', import.meta.url)))
  4. export const esbuildOptions = {
  5. entryPoints: [ './src/peertube.ts' ],
  6. bundle: true,
  7. platform: 'node',
  8. format: 'esm',
  9. target: 'node16',
  10. external: [
  11. './lib-cov/fluent-ffmpeg',
  12. 'pg-hstore'
  13. ],
  14. outfile: './dist/peertube.js',
  15. banner: {
  16. js: `const require = (await import("node:module")).createRequire(import.meta.url);` +
  17. `const __filename = (await import("node:url")).fileURLToPath(import.meta.url);` +
  18. `const __dirname = (await import("node:path")).dirname(__filename);`
  19. },
  20. define: {
  21. 'process.env.PACKAGE_VERSION': `'${packageJSON.version}'`
  22. }
  23. }
  24. await esbuild.build(esbuildOptions)