You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configure Vite for ESM-only build, vitest and update dependencies (#6)
* feat(build): configure Vite for ESM-only build and update dependencies
* fix(worker): correct ARController export extraction logic
* feat(plugin): improve worker readiness handling and fallback logic
* feat(build): set relative asset URLs and simplify asset file naming in Vite config
* feat(tests): add unit tests for ArtoolkitPlugin and configure coverage reporting
* feat(tests): add extra coverage tests for ArtoolkitPlugin and update coverage configuration
* feat(ci): add CI configuration and coverage tests for ArtoolkitPlugin
* feat(docs): update README and index.html for ESM module usage and paths
* chore: include dist build output
* feat(plugin): normalize detection updates and emit markerFound/Updated events
Copy file name to clipboardExpand all lines: README.md
+45-16Lines changed: 45 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,8 @@ ARToolKit marker detection plugin for AR.js core with WebAssembly support.
4
4
5
5
## Features
6
6
7
-
- Web Worker-based detection — marker detection runs off the main thread
7
+
- Web Worker-based detection — marker detection runs off the main thread (Browser Module Worker)
8
8
- ImageBitmap support — zero-copy frame transfer (browser)
9
-
- Cross-platform — browser Workers and Node.js worker_threads (stub path)
10
9
- ARToolKit integration — square pattern markers
11
10
- Event-driven API — marker found/updated/lost + raw getMarker forwarding
12
11
- Filtering — only forwards PATTERN_MARKER events above a minimum confidence
@@ -17,26 +16,53 @@ ARToolKit marker detection plugin for AR.js core with WebAssembly support.
17
16
npm install @ar-js-org/arjs-plugin-artoolkit
18
17
```
19
18
20
-
## Configuration (module + assets)
19
+
## Using the ESM build (recommended)
21
20
22
-
To ensure the Worker can import ARToolKit in the browser, pass an explicit ESM URL (recommended):
21
+
When you import the built ESM bundle from `dist/`, the worker and ARToolKit are already bundled and referenced correctly. You do NOT need to pass `artoolkitModuleUrl`.
- Serve from a web server so `/dist` assets resolve. The build is configured with `base: './'`, so the worker asset is referenced relative to the ESM file (e.g., `/dist/assets/worker-*.js`).
44
+
- In your own apps, place `dist/` where you serve static assets and import the ESM with the appropriate path (absolute or relative).
45
+
46
+
## Using source (development mode)
47
+
48
+
If you develop against `src/` (not the built `dist/`), the worker will attempt to dynamically import ARToolKit. In that case you should provide `artoolkitModuleUrl` or ensure your dev server can resolve `@ar-js-org/artoolkit5-js`.
0 commit comments