start.ts 470 B

12345678910111213141516
  1. import { pathToFileURL } from 'node:url'
  2. import { Context } from 'cordis'
  3. import Loader from '@cordisjs/plugin-loader'
  4. // Boot a Cordis app from this example's cordis.yml — the same shape as the
  5. // upstream `cordis` bin, pinned to this directory.
  6. const ctx = new Context()
  7. ctx.baseUrl = pathToFileURL(import.meta.dirname).href + '/'
  8. await ctx.plugin(Loader)
  9. await ctx.loader.create({
  10. name: '@cordisjs/plugin-include',
  11. config: {
  12. path: './cordis.yml',
  13. },
  14. })