Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vitejs/plugin-legacy

Package Overview
Dependencies
Maintainers
3
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitejs/plugin-legacy

**Note: this plugin requires `vite@^2.0.0`**.

  • 1.4.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
243K
decreased by-4.01%
Maintainers
3
Weekly downloads
 
Created

What is @vitejs/plugin-legacy?

@vitejs/plugin-legacy is a Vite plugin that provides support for legacy browsers by transpiling modern JavaScript syntax to ES5 and injecting polyfills for missing features. This allows developers to use modern JavaScript features while ensuring compatibility with older browsers.

What are @vitejs/plugin-legacy's main functionalities?

Transpile Modern JavaScript to ES5

This feature allows you to transpile modern JavaScript syntax to ES5, ensuring compatibility with older browsers. The 'targets' option specifies the browsers you want to support.

import legacy from '@vitejs/plugin-legacy';

export default {
  plugins: [
    legacy({
      targets: ['defaults', 'not IE 11']
    })
  ]
};

Inject Polyfills

This feature allows you to inject polyfills for missing features in older browsers. The 'polyfills' option specifies the polyfills you want to include.

import legacy from '@vitejs/plugin-legacy';

export default {
  plugins: [
    legacy({
      polyfills: ['es.promise.finally', 'es/map', 'es/set']
    })
  ]
};

Modern and Legacy Bundle

This feature allows you to create both modern and legacy bundles. The 'modernPolyfills' option ensures that modern browsers get a smaller bundle with only necessary polyfills.

import legacy from '@vitejs/plugin-legacy';

export default {
  plugins: [
    legacy({
      modernPolyfills: true
    })
  ]
};

Other packages similar to @vitejs/plugin-legacy

FAQs

Package last updated on 01 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc