vite-plugin-react-js-support weekly downloads statistics
By dravenww · npm · Vite plugins
vite plugin support for react with .js file
vite-plugin-react-js-support has 6,209 recorded weekly downloads on npm, a decrease of 55.6% over the past 30 days, ranking #1087 of 2,391 tracked listings.
About vite-plugin-react-js-support
vite-plugin-react-js-support
vite对jsx语法只认tsx和jsx后缀的文件,可是项目中有很多js类型的文件也是jsx;
安装
npm install --save-dev vite-plugin-react-js-support
or
yarn add vite-plugin-react-js-support
使用
import vitePlugin from 'vite-plugin-react-js-support';
export default {
plugins: [
vitePlugin([], { jsxInject: true }),
]
}
备注
// 对于vite预构建会报错的问题,需要把配置改下
export default ({command, mode}) => {
const rollupOptions = {};
if(command === 'serve') {
rollupOptions.input = []
}
return {
build: {
rollupOptions: rollupOptions
},
optimizeDeps: {
entries: false,
},
}
}
参数
// 之所以支持这个配置,是因为cra4版本以后在子文件中不会引入react;
// 如果你的子文件已经引入了react,可以把这项设置为false;
// 而且vite本身的jsxInject只对x(jsx|tsx)结尾的文件类型提供支持;
// 默认会根据react大于等于17的版本,自动注入
jsxInject: true, // 是否为js文件注入 import React from 'react';默认为true
还支持传入其他babel的plugin,数组类型。
Description from the npm listing.
- vite-plugin
- react-js
- react
- jsx
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (543)Similar npm Vite plugins plugins
All 20 vite-plugin-react-js-support alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/vite-plugin-react-js-support. First seen Oct 16, 2026; last successful collection Oct 21, 2026. See the methodology.