richardtallent / vite-plugin-singlefile

Vite plugin for inlining JavaScript and CSS resources
MIT License
859 stars 58 forks source link

Error [ERR_REQUIRE_ESM]: require() of ES Module ...\node_modules\vite-plugin-singlefile\dist\index.js from ...\vite.config.js not supported. #33

Closed conanliuhuan closed 2 years ago

conanliuhuan commented 2 years ago

Snipaste_2022-06-06_14-51-51

zhanglongqi commented 2 years ago

add "type": "module", to your package.json

tony19 commented 2 years ago

Duplicate of #23

A workaround is to install 0.7.1:

npm i -D vite-plugin-singlefile@0.7.1
richardtallent commented 2 years ago

Please try 0.10.0-beta and let me know if it helps. It should allow use in both CommonJS and ESM environments.

pitw commented 2 years ago

Got same error; With 0.10.0-beta it works 👍

richardtallent commented 2 years ago

0.10.0 has been released,