diff --git a/docs/999-big-list-of-options.md b/docs/999-big-list-of-options.md index 465930dab4c..a568fdd6559 100755 --- a/docs/999-big-list-of-options.md +++ b/docs/999-big-list-of-options.md @@ -1385,7 +1385,7 @@ Default: `true` Whether to apply tree-shaking and to fine-tune the tree-shaking process. Setting this option to `false` will produce bigger bundles but may improve build performance. You may also choose one of three presets that will automatically be updated if new options are added: -* `"smallest"` will choose option values for you to minimize output size as much as possible. This should work for most code bases as long as certain as you do not rely on certain patterns, which are currently: +* `"smallest"` will choose option values for you to minimize output size as much as possible. This should work for most code bases as long as you do not rely on certain patterns, which are currently: * getters with side effects will only be retained if the return value is used (`treeshake.propertyReadSideEffects: false`) * code from imported modules will only be retained if at least one exported value is used (`treeshake.moduleSideEffects: false`) * you should not bundle polyfills that rely on detecting broken builtins (`treeshake.tryCatchDeoptimization: false`) diff --git a/src/utils/options/mergeOptions.ts b/src/utils/options/mergeOptions.ts index b85fccff190..d3b908f0d61 100644 --- a/src/utils/options/mergeOptions.ts +++ b/src/utils/options/mergeOptions.ts @@ -181,7 +181,7 @@ const objectifyTreeshakeOption = (value: unknown): Record => { if (typeof value === 'string') { const preset = treeshakePresets[value as TreeshakingPreset]; if (preset) { - return (preset as unknown) as Record; + return preset as unknown as Record; } error( errInvalidOption( diff --git a/src/utils/options/normalizeInputOptions.ts b/src/utils/options/normalizeInputOptions.ts index 96cfba38885..7fdc96de610 100644 --- a/src/utils/options/normalizeInputOptions.ts +++ b/src/utils/options/normalizeInputOptions.ts @@ -27,9 +27,10 @@ export interface CommandConfigObject { globals: { [id: string]: string } | undefined; } -export function normalizeInputOptions( - config: InputOptions -): { options: NormalizedInputOptions; unsetOptions: Set } { +export function normalizeInputOptions(config: InputOptions): { + options: NormalizedInputOptions; + unsetOptions: Set; +} { // These are options that may trigger special warnings or behaviour later // if the user did not select an explicit value const unsetOptions = new Set(); @@ -38,7 +39,7 @@ export function normalizeInputOptions( const onwarn = getOnwarn(config); const strictDeprecations = config.strictDeprecations || false; const options: NormalizedInputOptions & InputOptions = { - acorn: (getAcorn(config) as unknown) as NormalizedInputOptions['acorn'], + acorn: getAcorn(config) as unknown as NormalizedInputOptions['acorn'], acornInjectPlugins: getAcornInjectPlugins(config), cache: getCache(config), context, @@ -102,7 +103,7 @@ const getAcornInjectPlugins = ( ): NormalizedInputOptions['acornInjectPlugins'] => ensureArray(config.acornInjectPlugins); const getCache = (config: InputOptions): NormalizedInputOptions['cache'] => - ((config.cache as unknown) as RollupBuild)?.cache || config.cache; + (config.cache as unknown as RollupBuild)?.cache || config.cache; const getIdMatcher = >( option: