{"library":"nuxt-vite-legacy","title":"Nuxt.js Legacy Browser Support with Vite","description":"The `nuxt-vite-legacy` module integrates `@vitejs/plugin-legacy` into Nuxt 3 applications, enabling support for older web browsers that do not fully adhere to modern JavaScript standards, specifically those lacking `<script type=\"module\">` support. It provides polyfills and a separate legacy bundle, addressing a gap that the core Nuxt team opted not to address directly. The current stable version is 2.0.1, which proactively supports Vite v7. This package maintains an irregular release cadence, typically updating to align with major or minor releases of Nuxt and Vite. Its primary differentiator is offering a practical solution for targeting very old browsers, which is not an out-of-the-box feature in modern Nuxt applications.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install nuxt-vite-legacy"],"cli":null},"imports":["modules: [\"nuxt-vite-legacy\"]","legacy: { targets: ['chrome 49'], additionalLegacyPolyfills: [...] }","import { defineNuxtConfig } from 'nuxt'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { defineNuxtConfig } from 'nuxt'\n\nexport default defineNuxtConfig({\n  // Ensure Nuxt.js is configured for SSR if you intend to use it with legacy browser detection.\n  ssr: true, \n  \n  // Add 'nuxt-vite-legacy' to the modules array to enable the plugin.\n  // This makes the module active in your Nuxt application.\n  modules: [\n    \"nuxt-vite-legacy\"\n  ],\n  \n  // Optionally, provide specific configuration options for @vitejs/plugin-legacy.\n  // This object is passed directly to the underlying Vite plugin.\n  legacy: {\n    // Define the browser targets for the legacy build. These are standard Browserslist queries.\n    // For example, 'chrome 49' targets Chrome version 49.\n    // For wider support, you might include 'ie 11' or 'safari 9'.\n    targets: [\n      \"chrome 49\",\n      \"IE 11\"\n    ],\n    // Add additional polyfills if certain APIs are missing in your target browsers \n    // and not automatically provided by @vitejs/plugin-legacy.\n    additionalLegacyPolyfills: [\n      // Example: Polyfilling getAttributeNames for very old browsers.\n      \"mdn-polyfills/Element.prototype.getAttributeNames\"\n    ],\n    // By default, the plugin generates both modern and legacy bundles.\n    // You can disable modern bundle generation if only legacy support is needed,\n    // but this is generally not recommended for performance.\n    modernPolyfills: true \n  }\n})","lang":"typescript","description":"This quickstart demonstrates how to install `nuxt-vite-legacy` and configure it in your `nuxt.config.ts` to target specific legacy browsers like Chrome 49, including additional polyfills.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}