Aller au contenu

@withstudiocms/buildkit

Ce contenu n’est pas encore disponible dans votre langue.

This is an esbuild based CLI kit for building Astro Integrations

Install the package in the root of the repo:

Fenêtre de terminal
npm i @withstudiocms/buildkit

Once you install the buildkit package you now have access to a buildkit CLI utility, add the following to your integration scripts:

package.json
{
"scripts": {
"build": "buildkit build 'src/**/*.{ts,astro,css}'",
"dev": "buildkit dev 'src/**/*.{ts,astro,css}'"
}
}

The command pattern is buildkit <command> 'path/to/file or glob/**/**.{ts}' [flags]

  • --no-clean-dist: Do not clean the dist output during build.
  • --bundle: Enable bundling.
  • --force-cjs: Force CJS output.
  • --tsconfig=tsconfig.json: Allows setting custom tsconfig for build time.
  • --outdir=dist: Allows settings the output directory.

The following file extensions will be copied from their src to their respective outputs and not transformed as if they are static assets.

  • .astro
  • .d.ts
  • .json
  • .gif
  • .jpeg
  • .jpg
  • .png
  • .tiff
  • .webp
  • .avif
  • .svg
  • .stub

For other content types and how to use them see The esBuild Docs^