vitejs / vite-plugin-vue

Vite Vue Plugins
MIT License
504 stars 155 forks source link

vite-plugin-require-transform don't work #369

Closed qiancheng900801 closed 8 months ago

qiancheng900801 commented 8 months ago

Related plugins

Describe the bug

vite : const Buffer = require('safe-buffer').Buffer; console.log(Buffer); //undefined webpack or node: const Buffer = require('safe-buffer').Buffer; console.log(Buffer); // Buffer why?

Reproduction

https://vitejsvite8tnkvo-bed1--5173--810981ba.local-credentialless.webcontainer.io/

Steps to reproduce

No response

System Info

System:
    OS: Windows 11 10.0.22621
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i9-13900H
    Memory: 1.38 GB / 15.63 GB
  Binaries:
    Node: 20.11.1 - C:\Program Files\nvm\nodejs\node.EXE
    npm: 10.2.4 - C:\Program Files\nvm\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (114.0.1823.43)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    @vitejs/plugin-vue: ^4.5.2 => 4.6.2
    vite: ^5.0.12 => 5.1.6

Used Package Manager

npm

Logs

No response

Validations

sapphi-red commented 8 months ago

This is not the repository of vite-plugin-require-transform.