Correct way to implement dynamic "require" imports #16624
thatgitsam
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to get access to external dependencies using vue.js & VITE, specifically device level packages on Brightsign media player devices that usually imported using
const DeviceInfo = require("@brightsign/deviceinfo")
, but can't find the right way to handle things in VITE. I've tried virtual modules, glob imports, await imports, and various other things, but wonder if I'm not looking in the right place.The packages only exist on the device when deployed, but we have mocks locally as required. We have it working with vue CLI & webpack like this:
Any pointers or assistance would be appreciated, as we would rather be working with the current vue.js stack!
Beta Was this translation helpful? Give feedback.
All reactions