@originjs/vite-plugin-commonjs
v1.0.3
Published
A vite plugin that support commonjs to esm in vite
Downloads
1,000,570
Readme
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.