vite-plugin / vite-plugin-commonjs

A pure JavaScript implementation for CommonJs
MIT License
96 stars 14 forks source link

please check support for flv.js(请检查对flv.js的支持) #53

Open Lazygui opened 1 week ago

Lazygui commented 1 week ago

When I use npm to install flv.js and import flvjs from 'flv.js' normally, and create a flvjs instance in onMounted, if the import {viteCommonjs} from' @ originjs/vite plugin commonjs' is configured in vite.config.ts; And in plugins: [viteCommonjs()], an error message will be prompted (vite+vue3+ts 当我使用npm install flv.js后正常import flvjs from 'flv.js',并在onMounted中创建 flvjs 实例时如果在vite.config.ts中配置了import { viteCommonjs } from "@originjs/vite-plugin-commonjs";并在plugins: [viteCommonjs ()],则提示错误)

[vite] Internal server error: Failed to resolve import "vertx" from "node_modules.vite\deps\flv_js.js?v=cddc8629". Does the file exist? image

Lazygui commented 1 week ago

Of course, you can also use the official built-in exclusion(当然也可以使用官方自带的排除) viteCommonjs({ exclude: "node_modules/.vite/deps/flv_js.js" }) But I still hope that the official compatibility with flv.js(但我还是希望官方兼容一下flv.js)