From f9dd87d3114120e1a7ac0ecb03370cf786d33bee Mon Sep 17 00:00:00 2001 From: Gavin Nitta Date: Fri, 1 Sep 2017 15:16:06 -0600 Subject: [PATCH] Alias for Ionic environment variables --- config/optimization.config.js | 5 ++++- config/webpack.config.js | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/config/optimization.config.js b/config/optimization.config.js index f28d1f47..5e2e3b68 100644 --- a/config/optimization.config.js +++ b/config/optimization.config.js @@ -11,7 +11,10 @@ module.exports = { }, resolve: { - extensions: ['.js', '.ts'] + extensions: ['.js', '.ts'], + alias: { + '@app/env': path.resolve('src/environments/environment' + (process.env.IONIC_ENV === 'prod' ? '' : '.' + process.env.IONIC_ENV) + '.ts') + } }, module: { diff --git a/config/webpack.config.js b/config/webpack.config.js index 60d8a959..e1bd4768 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -21,7 +21,10 @@ module.exports = { resolve: { extensions: ['.ts', '.js', '.json'], - modules: [path.resolve('node_modules')] + modules: [path.resolve('node_modules')], + alias: { + '@app/env': path.resolve('src/environments/environment' + (process.env.IONIC_ENV === 'prod' ? '' : '.' + process.env.IONIC_ENV) + '.ts') + } }, module: { @@ -53,4 +56,4 @@ module.exports = { net: 'empty', tls: 'empty' } -}; \ No newline at end of file +};