13. The solution that minio cannot be used in the vite project

problem background

        The project needs to upload a large file. Since it is a large file, it is not advisable to read, send and receive it at one time, which will easily lead to memory problems. Therefore, for large file uploads, it is necessary to implement slice uploads and breakpoint resume uploads. It is relatively troublesome to implement it by yourself, but the good news is that our background file service uses the open source minio as the object storage service, and minio also provides JavaScript Client SDK, but when I saw the document was preparing for a meal, I encountered question:

problem analysis 

After analyzing the error report, we found that the reason is that our project uses vite to build, and vite uses the import method of es6 standard by default, and does not support require

Guess you like

Origin blog.csdn.net/qq_43185384/article/details/127672652