Open mkuklis opened 8 years ago
Hi guys,
I ran into a situation where I needed to pass some env variables to the ionic build. This pull request adds support for envify. This should allow to pass variables from gulp like this:
gulp.task('build', ['clean'], function(done){ runSequence( ['sass', 'html', 'fonts', 'scripts'], function(){ buildBrowserify({ minify: isRelease, browserifyOptions: { debug: !isRelease }, uglifyOptions: { mangle: false }, envifyOptions: { ENV: 'production' } }).on('end', done); } ); });
and later access them with:
if (process.env.ENV == "production") { // do something }
It looks like some other people asked about it too:
https://forum.ionicframework.com/t/debate-ionic-2-environment-development-variables-setup/44061
Hi guys,
I ran into a situation where I needed to pass some env variables to the ionic build. This pull request adds support for envify. This should allow to pass variables from gulp like this:
and later access them with:
It looks like some other people asked about it too:
https://forum.ionicframework.com/t/debate-ionic-2-environment-development-variables-setup/44061