I'm trying to use react-flagpack
in my project that uses Vite, but whenever I use it i get the following error:
Uncaught Error: Dynamic require of "node_modules/flagpack-core/dist/flags/cDBuMQWP.svg" is not supported
Is this an issue with Vite? or am I doing something wrong.
Thanks in advance!
As of June 14th 2021 it's now supported. :3
Can you use this :
npm i --save @originjs/vite-plugin-require-context
Then Add ViteRequireContext
into vit.config.js
:
import ViteRequireContext from "@originjs/vite-plugin-require-context";
export default defineConfig(() => {
plugins: [
ViteRequireContext(),
],
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With