I have a typescript file like below,
Environment.ts
var Environment = "DEV"
exports.Environment = Environment;
And I am using it in my app.config file like below,
var execEnv = require('./src/execEnvironment.ts');
which gives me the error
cannot find name 'exports'.
What am I doing wrong?
Use "standarized" ES6 style exports which are supported by Typescript
environment.ts
export const Environment = "DEV"
app.config.ts
import {Environment} from './environment' // <= no .ts at the end
You can even rename on import
import {Environment as execEnv} from './environment'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With