diff --git a/packages/kit/src/module/utils.ts b/packages/kit/src/module/utils.ts index 88a6158a30..bc5b907e03 100644 --- a/packages/kit/src/module/utils.ts +++ b/packages/kit/src/module/utils.ts @@ -180,6 +180,13 @@ export interface ExtendWebpackConfigOptions extends ExtendConfigOptions { * @default true */ client?: boolean + /** + * Install plugin on modern build + * + * @default true + * @deprecated Nuxt 2 only + */ + modern?: boolean } export interface ExtendViteConfigOptions extends ExtendConfigOptions {} @@ -216,6 +223,13 @@ export function extendWebpackConfig ( fn(config) } } + // Nuxt 2 backwards compatibility + if (options.modern !== false) { + const config = configs.find(i => i.name === 'modern') + if (config) { + fn(config) + } + } }) }