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

Ionic Environment Variables not set for uglify-js #1162

@micha-walter

Description

@micha-walter

Note: for support questions, please use one of these channels:

https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/

Short description of the problem:

All scripts see the Ionic Environment Variables except the uglify-js.

In APP\node_modules@ionic\app-scripts\config\uglifyjs.config.js is process.env.IONIC_ENV always undefined.

What behavior are you expecting?

uglify-js should see the Ionic Environment Variables also, so i can switch between prod or dev mode for example

Steps to reproduce:

  1. extend APP\node_modules@ionic\app-scripts\config\uglifyjs.config.js which the following lines
  2. run: "ionic build --prod" or ionic cordova build platform --prod
  3. you see no env variable for IONIC_*.
insert any relevant code between the above and below backticks
const util = require('util');
process.stdout.write(Ionic Environment Variables"\n" + util.inspect(process.env) + "\n");

Which @ionic/app-scripts version are you using?
cli packages: (path_removed\node_modules)

@ionic/cli-plugin-cordova       : 1.6.2
@ionic/cli-plugin-ionic-angular : 1.4.1
@ionic/cli-plugin-proxy         : 1.4.1
@ionic/cli-utils                : 1.7.0
ionic (Ionic CLI)               : 3.7.0

global packages:

Cordova CLI : 7.0.1

local packages:

@ionic/app-scripts : 2.1.3
Cordova Platforms  : android 6.2.3 ios 4.4.0
Ionic Framework    : ionic-angular 3.6.0

System:

Android SDK Tools : 26.0.2
Node              : v7.8.0
OS                : Windows 8.1
npm               : 5.0.3

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

This issue is on windows and on mac also.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions