Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Alias for Ionic environment variables #1201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gshigeto
Copy link

@gshigeto gshigeto commented Aug 31, 2017

Short description of what this resolves:

Enables environment variables for any IONIC_ENV

Changes proposed in this pull request:

  • Create an alias @app/env for users to import their environment variables

Fixes: #762

Second half of this implementation in pull request for ionic2-app-base

@gshigeto
Copy link
Author

The second half of this implementation in pull request for ionic2-app-base

@janpio
Copy link

janpio commented Sep 20, 2017

Oh wow, this looks neat!

Is there some documentation on how this would be used somewhere?
Was this presented and explained in #762?

@gshigeto
Copy link
Author

Thank you!

I am sorry as this is my first PR for an open source project and don't know proper protocol.

I commented on a thread for environment variables here.
Here is the link to my sample repo that I made for it.

@janpio
Copy link

janpio commented Sep 20, 2017

I think you might also want to post in #762 with a short summary how it works and how you would use this in the project when merged.

@gshigeto gshigeto mentioned this pull request Sep 20, 2017
@tabirkeland
Copy link

Utilizing this currently in a project, had to resolve issues for both custom webpack.config.js and optimization.config.js, see below:

var path = require('path');
var defaultConfig = require('@ionic/app-scripts/config/webpack.config.js');

module.exports = function () {
	const alias = {
		"@app/env" : path.resolve('./src/environments/environment.ts')
	};
	defaultConfig.dev.resolve.alias = alias;
	defaultConfig.prod.resolve.alias = alias;

	return defaultConfig;
};

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants