Skip to content

Commit 2f6b04c

Browse files
authored
Merge pull request #1490 from vitejs/sync-f8739196-1
docs(en): merge docs-cn/sync-docs into docs-cn/dev @ f873919
2 parents e366605 + b433f3d commit 2f6b04c

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

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+
rolldownOptions: {
239+
output: {
240+
postBanner:
241+
'/* See licenses of bundled dependencies at https://example.com/license.md */',
242+
},
243+
},
244+
},
245+
})
246+
```
247+
248+
:::
249+
226250
## build.manifest {#build-manifest}
227251

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

0 commit comments

Comments
 (0)