For example, I have a compiled binary cudaDeviceQuery
which returns a list of devices as JSON. Here\'s a piece of code:
export default function
There are two things. If you set __dirname: true
in your web app config you will get the relative
path of the file from your context directory
If you set __dirname: false
then __dirname
will have the full path.
Development Mode
You have two options
__dirname: true
and concatenate it with os.cwd()
__dirname: false
and use __dirname
directlyProduction Mode
__dirname: true
and use os.cwd()
.__dirname: true
and use process.resourcePath
I will prefer 2 as the preferred approach in production