@originjs/vite-plugin-commonjs
A vite plugin that support commonjs to esm in vite
Last updated 5 years ago by jiawulin .
MulanPSL2 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @originjs/vite-plugin-commonjs 
SYNC missed versions from official npm registry.

vite-plugin-commonjs

Support commonJS to esm in vite

Install

npm install @originjs/vite-plugin-commonjs --save-dev

or

yarn add @originjs/vite-plugin-commonjs --dev

Usage

import { viteCommonjs } from '@originjs/vite-plugin-commonjs'

export default {
    plugins: [
        viteCommonjs()
    ]
}

Options

  • exclude: string[] Dependencies to exclude from transform.

  • include: string[] Dependencies that only need to be transform.

CommonJS module in node_modules

import { esbuildCommonjs } from '@originjs/vite-plugin-commonjs'

export default {
    optimizeDeps:{
    esbuildOptions:{
      plugins:[
        esbuildCommonjs(['react-calendar','react-date-picker']) 
      ]
    }
  }
}

Options

  • include: string[] Dependent modules need to be transform.

Current Tags

  • 1.0.3                                ...           latest (5 years ago)

8 Versions

  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 1.0.0-beta7                                ...           5 years ago
  • 1.0.0-beta6                                ...           5 years ago
  • 1.0.0-beta5                                ...           5 years ago
  • 1.0.0-beta3                                ...           5 years ago
Downloads
Total 22
Today 0
This Week 0
This Month 22
Last Day 0
Last Week 10
Last Month 0
Dependencies (1)
Dev Dependencies (3)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE