I have one file "appsettings.json". It has configuration for some other purpose. I want to put variables from "environment.ts" and "environment.prod.ts" to this file and access inside environment files.
If I'm trying to import/require "appsettings.json" and use values it works in development mode but not in "--prod" with aot enabled. --prod --aot=false works fine
Error being thrown: ERROR in Error encountered resolving symbol values statically. Reference to a local (non-exported) symbol 'json'. Consider exporting the symbol (position 3:5 in the original .ts file), resolving symbol CONFIG
"ExtraConf" : {
"CDNPATH": "https://share-dev-cdn.test.net/",
"ICONPATH":"skin/icons/",
"APPLTITLE":"Title"
},
"Environments" : {
"production": false,
"appInsights": {
"appkey":"0908776554"
}
},
"EnvironmentsProd" : {
"production": true,
"appInsights": {
"appkey":"55678900"
}
}
environment.ts
declare var require: any;
var json:any = require("../../appsettings.json");
export const environment = json.Environments;