feat(cli): add build.bundleOptions config (#10751)

This commit is contained in:
neverland
2022-06-26 21:42:28 +08:00
committed by GitHub
parent bb23e1b700
commit 293dab6a51
4 changed files with 106 additions and 32 deletions

View File

@@ -221,6 +221,45 @@ module.exports = {
`npm` package manager.
### build.bundleOptions
- Type: `BundleOptions[]`
Specify the format of the bundled output.
The type of `BundleOptions`:
```ts
type BundleOption = {
// Whether to minify code (Tips: es format output can't be minified by vite)
minify?: boolean;
// Formats, can be set to 'es' | 'cjs' | 'umd' | 'iife'
formats: LibraryFormats[];
// Dependencies to external (Vue is externaled by default)
external?: string[];
};
```
Default value
```ts
const DEFAULT_OPTIONS: BundleOption[] = [
{
minify: false,
formats: ['umd'],
},
{
minify: true,
formats: ['umd'],
},
{
minify: false,
formats: ['es', 'cjs'],
external: allDependencies,
},
];
```
### site.title
- Type: `string`