Closed sohayb closed 4 years ago
@sohayb Node.js in LiquidCore cannot access resources directly. This is intentional. To require
other js files, you must use a bundler. liquidcore-cli
has this feature. See the Hello World tutorial for info on how to install it. To create the bundle, you can use:
npm run bundler -- --platform=android --entry-file=MyEntryJSFile.js --bundle-output=MyBundledFile.js
If you required another file (e.g. converter.js
), it will get bundled into MyBundledFile.js
and work as you expect.
Thanks a lot @ericwlange . Will try that out and let you know and close this ticket 👍
This worked perfectly, thanks 🙌
Hello, In my Android app, I'm starting a
js
file from theres/raw
folder as a MicroService, In that file, I'm importingjs
library from the same folder but it's not working. I tried 2 different approaches:Please note that when running those
js
files on the dev machine, the first way obviously works, but on Android it doesn't. Any help on how to do this? Please note that when I tried the other approach of just loading the library into aJSContext
, I got an exceptionReference Error: module is not defined