Skip to content

Commit

Permalink
docs: add configuration example (#86)
Browse files Browse the repository at this point in the history
* Add configuration example

* Update README.md

Co-authored-by: pooya parsa <pyapar@gmail.com>
  • Loading branch information
caffeinum and pi0 authored Jun 22, 2022
1 parent fb3303a commit 2831b36
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2831b36

Please sign in to comment.