-
-
Save abner/d76209e4b4e4fe305b5e83e03205dd12 to your computer and use it in GitHub Desktop.
Ionic 3.9.2 Environment Variables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface Environment { | |
DEBUG : boolean; | |
API_URL : string; | |
WS_URL : string; | |
BASE_URL : string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Environment } from './environment.interface'; | |
export const ENV: Environment = { | |
DEBUG : true, | |
WS_URL : 'ws://10.1.1.1/', | |
API_URL : 'http://10.1.1.1/api/' | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
var defaultConfig = require('@ionic/app-scripts/config/optimization.config.js'); | |
const DEV_ENV = './src/environments/environment.ts'; | |
const PROD_ENV = './src/environments/environment.prod.ts'; | |
const devAlias = { | |
"@app/env" : path.resolve(DEV_ENV) | |
}; | |
const prodAlias = { | |
"@app/env" : path.resolve(PROD_ENV) | |
}; | |
module.exports = function () { | |
defaultConfig.dev.resolve.alias = devAlias; | |
defaultConfig.prod.resolve.alias = prodAlias; | |
return defaultConfig; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"config": { | |
"ionic_aot_write_to_disk": true, | |
"ionic_optimization": "./config/optimization.config.js", | |
"ionic_webpack": "./config/webpack.config.js" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"allowSyntheticDefaultImports": true, | |
"declaration": false, | |
"emitDecoratorMetadata": true, | |
"experimentalDecorators": true, | |
"lib": [ | |
"dom", | |
"es2015" | |
], | |
"module": "es2015", | |
"moduleResolution": "node", | |
"sourceMap": true, | |
"target": "es5", | |
"baseUrl" : "./src", | |
"paths" : { | |
"@app/env" : [ | |
"environments/environment" | |
] | |
} | |
}, | |
"include": [ | |
"src/**/*.ts" | |
], | |
"exclude": [ | |
"node_modules" | |
], | |
"compileOnSave": false, | |
"atom": { | |
"rewriteTsconfig": false | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
var defaultConfig = require('@ionic/app-scripts/config/webpack.config.js'); | |
const DEV_ENV = './src/environments/environment.ts'; | |
const PROD_ENV = './src/environments/environment.prod.ts'; | |
const devAlias = { | |
"@app/env" : path.resolve(DEV_ENV) | |
}; | |
const prodAlias = { | |
"@app/env" : path.resolve(PROD_ENV) | |
}; | |
module.exports = function () { | |
defaultConfig.dev.resolve.alias = devAlias; | |
defaultConfig.prod.resolve.alias = prodAlias; | |
return defaultConfig; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment