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

@originjs/vite-plugin-commonjs

Package Overview
Dependencies
Maintainers
5
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@originjs/vite-plugin-commonjs

A vite plugin that support commonjs to esm in vite

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
237K
increased by1.04%
Maintainers
5
Weekly downloads
 
Created

What is @originjs/vite-plugin-commonjs?

@originjs/vite-plugin-commonjs is a Vite plugin that allows you to use CommonJS modules in a Vite project. This is particularly useful for integrating legacy code or third-party libraries that are not available as ES modules.

What are @originjs/vite-plugin-commonjs's main functionalities?

Transform CommonJS to ES Modules

This feature allows you to transform CommonJS modules into ES modules, making it easier to integrate with Vite's modern build system.

import commonjs from '@originjs/vite-plugin-commonjs';

export default {
  plugins: [commonjs()]
};

Custom Named Exports

This feature allows you to specify custom named exports for CommonJS modules, which can be useful when the default export behavior does not meet your needs.

import commonjs from '@originjs/vite-plugin-commonjs';

export default {
  plugins: [
    commonjs({
      namedExports: {
        'example-package': ['namedExport1', 'namedExport2']
      }
    })
  ]
};

Exclude Specific Modules

This feature allows you to exclude specific modules from being transformed, which can be useful if you want to handle certain modules differently.

import commonjs from '@originjs/vite-plugin-commonjs';

export default {
  plugins: [
    commonjs({
      exclude: ['module-to-exclude']
    })
  ]
};

Other packages similar to @originjs/vite-plugin-commonjs

Keywords

FAQs

Package last updated on 16 Feb 2022

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