Skip to content

Fix: Configure webpack and update image target assets to make example work#2

Open
tkada wants to merge 7 commits into8thwall:mainfrom
tkada:fix/image_target
Open

Fix: Configure webpack and update image target assets to make example work#2
tkada wants to merge 7 commits into8thwall:mainfrom
tkada:fix/image_target

Conversation

@tkada
Copy link
Copy Markdown

@tkada tkada commented Apr 2, 2026

Problem

The example was not working due to incorrect image target asset configuration and webpack setup.

Changes

  • Updated webpack configuration to properly handle image target assets with asset/source type
  • Configured webpack to resolve .json files for image targets
  • Converted image target files from .js to .json format (model-target and video-target)
  • Added required image assets (_cropped, _luminance, _original, _thumbnail variants) for each target
  • Updated src/app.js to properly import and register image targets
  • Cleaned up src/index.html to remove inline script declarations

Result

The example now works correctly with proper image target recognition.

Testing

Tested locally and confirmed that:

  • The application builds successfully
  • Image targets are properly loaded and recognized
  • AR functionality works as expected

tkada added 7 commits April 2, 2026 11:23
- 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
@tkada tkada changed the title Fix/image target Fix: Configure webpack and update image target assets to make example work Apr 2, 2026
Copy link
Copy Markdown

@AA-Nassim AA-Nassim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ¯\_(ツ)_/¯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants