Closed peternepp closed 4 years ago
It’s some time ago I’ve used that kind of setup with requirejs, but I’ll try to reconstruct how to use it (the readme was updated by me back then). Attached you can find an (unfinished) boilerplate extension I had once begun which also uses requirejs. Can’t tell if and how it currently compiles, but the app.jsx still executes fine in PS 2020 with a module loaded by requirejs.
I think the trick was to append requirejs module loading at last in code and by exposing the loaded modules to global space. I hope you can figure it out with the attached example.
Here are some more links with different explanations on how to use requirejs in conjunction with typescript: https://www.stevefenton.co.uk/2013/02/using-requirejs-and-jquery-in-typescript/ https://medium.com/@kulor/typescript-and-requirejs-442be2043833 https://stackoverflow.com/questions/14587720/using-requirejs-alongside-non-amd-javascript-files
The technique seems to be similar except that I had put module loading with requirejs into a separate expose.js file. extension.zip
@perludum Many thanks for the information. I'll have a look at it.
I'm really interested in how to use 'real' modules with Typescript/ExtendScript.
@felixSchl In readme.md you mentioned that it is possible via requirejs:
I'm curios what configuration that might be? Can you describe that a little more please?
Thanks a lot, Peter