From 2831b36b59d79125b281489331094263c665ec0e Mon Sep 17 00:00:00 2001 From: Aleksey Bykhun Date: Wed, 22 Jun 2022 19:10:57 +0800 Subject: [PATCH] docs: add configuration example (#86) * Add configuration example * Update README.md Co-authored-by: pooya parsa --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 4fad371..58fe3f4 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,32 @@ You can either use `unbuild` key in `package.json` or `build.config.{js,ts,json} See options [here](./src/types.ts). +Example: + +```ts +import { defineBuildConfig } from 'unbuild' + +export default defineBuildConfig({ + // If entries is not provided, will be automatically inferred from package.json + entries: [ + // default + './src/index', + // mkdist builder transpiles file-to-file keeping original sources structure + { + builder: 'mkdist', + input: './src/package/components/', + outDir: './build/components' + }, + ], + + // Change outDir, default is 'dist' + outDir: 'build', + + // Generates .d.ts declaration file + declaration: true, +}) +``` + ## 💻 Development - Clone this repository