Skip to content

Commit 1bac92f

Browse files
authored
docs(config): add build.license comment example (#2316)
1 parent e154ef7 commit 1bac92f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

config/build-options.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,30 @@ export default defineConfig({
223223
]
224224
```
225225

226+
::: tip
227+
228+
ビルドされたコード内でライセンスファイルを参照したい場合は、`build.rolldownOptions.output.postBanner` を使用してファイルの先頭にコメントを挿入できます。例:
229+
230+
<!-- TODO: add a link for output.postBanner above to Rolldown's documentation -->
231+
232+
```js twoslash [vite.config.js]
233+
import { defineConfig } from 'vite'
234+
235+
export default defineConfig({
236+
build: {
237+
license: true,
238+
rollupOptions: {
239+
output: {
240+
postBanner:
241+
'/* バンドルされた依存関係のライセンスは https://example.com/license.md を参照 */',
242+
},
243+
},
244+
},
245+
})
246+
```
247+
248+
:::
249+
226250
## build.manifest
227251

228252
- **型:** `boolean | string`

0 commit comments

Comments
 (0)