This repository is a reproduction case for vite issue todo.
To reproduce:
- Clone this repo.
- Install dependencies (
npm ci
) - Start vite (
npm run dev
)
You'll see the following error in the console:
Uncaught ReferenceError: require is not defined
js entry.js:8
__require chunk-L26DXZYY.js:12
<anonymous> react-date-picker:1
The require in question is a css
import from the react-date-picker
library:
require("react-calendar/dist/Calendar.css");
Indeed, this isn't getting rewritten by the vite process.