Skip to content

Commit

Permalink
docs: add more usage info (#401)
Browse files Browse the repository at this point in the history
* WIP  docs: add more detailed explanation for `--stub'

* docs: add some feature configuration methods

* update

* update

* update

---------

Co-authored-by: Pooya Parsa <[email protected]>
  • Loading branch information
RSS1102 and pi0 authored Oct 5, 2024
1 parent 7646e37 commit 11fccdd
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Integration with [mkdist](https://github.com/unjs/mkdist) for generating bundlel

### ✨ Passive watcher

Stub `dist` once using [jiti](https://github.com/unjs/jiti) and you can try and link your project without needing to watch and rebuild during development.
Stub `dist` once using `unbuild --stub` (powered by [jiti](https://github.com/unjs/jiti)) and you can try and link your project without needing to watch and rebuild during development.

### ✍ Untype Generator

Expand All @@ -50,6 +50,10 @@ Update `package.json`:
```json
{
"type": "module",
"scripts": {
"build": "unbuild",
"prepack": "unbuild"
},
"exports": {
".": {
"import": "./dist/index.mjs",
Expand Down Expand Up @@ -157,6 +161,38 @@ export default defineBuildConfig([
]);
```

## Recipes

### Decorators support

In `build.config.ts`

```ts
import { defineBuildConfig } from "unbuild";

export default defineBuildConfig({
rollup: {
esbuild: {
tsconfigRaw: {
compilerOptions: {
experimentalDecorators: true,
},
},
},
},
});
```

### Generate sourcemaps

```ts
import { defineBuildConfig } from "unbuild";

export default defineBuildConfig({
sourcemap: true,
});
```

## 💻 Development

- Clone this repository
Expand Down

0 comments on commit 11fccdd

Please sign in to comment.