Recently, the company’s projects are getting bigger and bigger. It takes one or two minutes to start each time. In order to find the fish for a longer time, I decided to switch to Vite
Direct reference to Yamami’s gadgets:wp2vite
Even after you use it, you still find many minor problems:
1. Require cannot be used in vite when importing multiple files in a folder
Context (‘./modules’, true, ‘.js$’) import.meta. GlobEager (‘./modules/*.js’)
2. SVG cannot use the solution:
Github.com/anncwb/vite…
3. JSX cannot be used
Add lang=’ JSX ‘to script tag
4. Path cannot be used
NPM I path-browserify; Import path from ‘path-browserify’ import path from ‘path-browserify’
5.unexpected token < in JSON at postiion 0
I encountered this problem for a variety of reasons. ‘, can’t parse, just write it in a different way.