Skip to content

Commit

Permalink
fix!: Breaking change: core-js polyfilling is now disabled by default…
Browse files Browse the repository at this point in the history
… as server core already includes polyfills

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Jul 11, 2023
1 parent 0f6d87f commit a029116
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/baseConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ export interface BaseOptions {
*/
nodePolyfills?: boolean | NodePolyfillsOptions
/**
* Adjust settings for core-js polyfills
* Enable and adjust settings for core-js polyfills
*
* By default enabled with `{ usage: true }`
* By default disabled as Nextcloud core already includes the `core-js/stable` polyfills globally
*/
coreJS?: boolean | CoreJSPluginOptions
coreJS?: CoreJSPluginOptions
/**
* Vite config to override or extend the base config
*/
Expand Down Expand Up @@ -83,9 +83,9 @@ export function createBaseConfig(options: BaseOptions = {}): UserConfigFn {
values: options.replace,
}))
}
if (options.coreJS !== false) {
if (options.coreJS !== undefined) {
// Add required polyfills, by default browserslist config is used
plugins.push(corejsPlugin(typeof options.coreJS === 'object' ? options.coreJS : undefined))
plugins.push(corejsPlugin(options.coreJS))
}

return mergeConfig(defineConfig({
Expand Down

0 comments on commit a029116

Please sign in to comment.