Fix: Configure webpack and update image target assets to make example work#2
Fix: Configure webpack and update image target assets to make example work#2tkada wants to merge 8 commits into8thwall:mainfrom
Conversation
- Add src/targets to resolve.modules so target files can be required without path prefix - Serve src/targets at /targets, /image-targets, and / via devServer.static - Exclude .json files from asset-loader to allow webpack native JSON parsing - Fix require paths in app.js to use short module names Made-with: Cursor
There was a problem hiding this comment.
Thanks for the fix, worked great for me !
One small note: since this version now uses HTTPS in the dev server, is step 5 in the README ("To connect to a mobile device, follow these instructions") still relevant? It might be worth revisiting or removing it to avoid confusion.
Edit : Or maybe go back to HTTP and keep the connect to mobile instructions for more consistency across the tutorials. Both seem good to me ¯\_(ツ)_/¯
Made-with: Cursor
|
@AA-Nassim We kept HTTPS for the dev server because browsers need a secure context for camera access, so switching back to plain HTTP would break that again. Instead of removing the mobile step, we revised the README so the flow matches this setup: generate key.pem / cert.pem → npm run serve → on the same Wi‑Fi, open https://: and handle the self‑signed cert warning. We also clarified that the linked “Test on Mobile” doc is mainly about ngrok (and simulator-style workflows), so it’s optional for LAN testing but still useful if someone wants a tunnel. Happy to tweak the wording further if anything still feels confusing. |
|
Thanks for this change, unfortunately I missed it until now. Is there anything left that we should take a look at or did I already fix things to a sufficient degree? |
Problem
The example was not working due to incorrect image target asset configuration and webpack setup.
Changes
asset/sourcetype.jsonfiles for image targets.jsto.jsonformat (model-target and video-target)src/app.jsto properly import and register image targetssrc/index.htmlto remove inline script declarationsResult
The example now works correctly with proper image target recognition.
Testing
Tested locally and confirmed that: