Trying to add typescript with webpack - 01 attempt#167
Conversation
- doesn't change anything, issue remain
| "*": [ | ||
| "../node_modules/*" | ||
| "../node_modules/*", | ||
| ], |
There was a problem hiding this comment.
This should be the right mode to resolving alias with typescript and webpack, following this article https://stackoverflow.com/questions/40443806/webpack-resolve-alias-does-not-work-with-typescript but according to one of the answers is possible to use @babel/preset-typescript without ts-loader
|
With 0b7175c the camera is loaded and the video si displayed. |
|
now it start to load the worker but fails to find it: |
|
❗ With the latest 6252e00 worker is loaded, camera is loaded and NFT marker is loaded! 👍 🥳 🙌 |
|
with c92f6d7 the worker is inlined thanks to this issue webpack-contrib/worker-loader#282 +declare module 'worker-loader*' {
-declare module "worker-loader!*" {and NFTWorker.ts: +import Worker from 'worker-loader?inline=no-fallback!./Worker';
-import Worker from "worker-loader!./Worker"; |
|
With 2fe653c The examples/arNFT_threejs_example.html is able to detect and track the pinball image, but no mesh (or other stuff) is displayed. This is not my intention now. I'm testing only the logic. |
9c99845 to
aac02e3
Compare
|
Closing this PR, better to continue on #184 |
This is an alternative approach to #158 solve part of the issues but other arise, in specific, it's easier to setup the worker-loader but i had to modify the code, i had to add the index.ts entry as a default export and ARnft is exported also as a default class.
Maybe because the project is compiled as UMD? Anyway in the
ARnft_threejs_example.htmli get:this only happens if you try to run the code in a module environment. I hope to fix this.