Dynamic import based on environment variable
In a project I have a environment varible which should be used to specifiy wheter we would like to use HTTPS or not:
In a project I have a environment varible which should be used to specifiy wheter we would like to use HTTPS or not:
By using require(./filename)
I can include and execute the code inside filename without any export defined inside filename itself.
I’m learning node.js and am wondering why it uses the require
syntax rather than the import
syntax which React uses.