@originjs/vite-plugin-commonjs
A vite plugin that support commonjs to esm in vite
Last updated 5 years ago by flyfishzy .
MulanPSL2 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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 (4 years ago)

8 Versions

  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 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
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 5
Dependencies (1)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org | Home |