Here's what I learned about importing files to use in other files in Typescript.
Here's the syntax I would put for pulling a file into my new file to use it:
import * MyOtherFile from "destination/path";
Here's how it looks in retrospect:
import * as MenuBuilder from "menubuilder/menubuilder";
The real question here is why... why didn't this work in the first place? Well. There can be all sorts of issues. I've found that not having your workspace starting from
clientside_packages in Visual Studio Code can lead to all sorts of issues. Your solution is to just re-open your projects from clientside_packages and re-initialize your Typescript setup with
This is probably one of the larger solutions to the issues.
Then there is the
tsconfig.json settings you may or may not need.
Add this to your tsconfig:
That means it will sound the base of the folder as your root directory. Hence why
menubuilder/menubuilder up there makes more sense when you look at my folder structure.
What did we learn? Setup a workspace properly. Configure your typescript correctly. When things don't work out, retrace your steps all the way back to the beginning.
Also for anyone who is curious. Wherever
index.js is located is where Rage begins looking for scripts. So doing
sandbox is not going to solve your issue. When it begins looking it'll look one step back from our currenct directory which is
Hope this helps someone out there because this issue was quite torturous.