Skip to content

Commit b075fb7

Browse files
committed
docs: add banner info
1 parent 006065e commit b075fb7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/config/build-options.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,27 @@ If the `fileName` ends with `.json`, the raw JSON metadata will be generated ins
229229
]
230230
```
231231

232+
::: tip
233+
If you'd like to reference the license file in the built code, you can use `build.rollupOptions.output.banner` to inject a comment at the top of the files. For example:
234+
235+
```js twoslash [vite.config.js]
236+
import { defineConfig } from 'vite'
237+
238+
export default defineConfig({
239+
build: {
240+
license: true,
241+
rollupOptions: {
242+
output: {
243+
banner:
244+
'/* See licenses of bundled dependencies at https://example.com/license.md */',
245+
},
246+
},
247+
},
248+
})
249+
```
250+
251+
:::
252+
232253
## build.manifest
233254

234255
- **Type:** `boolean | string`

0 commit comments

Comments
 (0)