Commit f709dee1 authored by Julien Enselme's avatar Julien Enselme

chore(environments): switch from JSON to JS files

It's what the aurelia-cli expects now.
parent 700894e1
Pipeline #75270291 passed with stages
in 3 minutes and 59 seconds
{
export default {
"api": {
"host": "localhost",
"path": "/ws/",
......
{
export default {
"api": {
"host": "api.arenaoftitans.com",
"path": "/ws/",
......
{
export default {
"api": {
"host": "devapi.arenaoftitans.com",
"path": "/ws/",
......
{
export default {
"api": {
"host": "api.aot.testing",
"path": "/ws/",
......
......@@ -13,16 +13,17 @@ import {getVersion, dumpAsExportedData} from './utils';
function configureEnvironment() {
let env = CLIOptions.getEnvironment();
return gulp.src(`aurelia_project/environments/${env}.json`)
.pipe(transform('utf8', content => {
const data = JSON.parse(content);
data.version = getVersion();
data.api.host = process.env.API_HOST || data.api.host;
data.api.port = process.env.API_PORT || data.api.port;
data.api.port = parseInt(data.api.port, 10);
data.api.version = process.env.API_VERSION || data.api.version;
const environment = require(`../environments/${env}.js`).default;
return dumpAsExportedData(data);
return gulp.src(`aurelia_project/environments/${env}.js`)
.pipe(transform('utf8', () => {
environment.version = getVersion();
environment.api.host = process.env.API_HOST || environment.api.host;
environment.api.port = process.env.API_PORT || environment.api.port;
environment.api.port = parseInt(environment.api.port, 10);
environment.api.version = process.env.API_VERSION || environment.api.version;
return dumpAsExportedData(environment);
}))
.pipe(changedInPlace({firstPass: true}))
.pipe(rename('environment.js'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment