Ionic2 when use --prod always build dev version to me


#1

hi~~ help,help
when i use --prod,i always have build dev started…,why?

my build option is : ionic build android --prod

**
[19:35:23] ionic-app-scripts 1.1.4
[19:35:23] build dev started …
[19:35:23] clean started …
[19:35:23] clean finished in 15 ms
[19:35:23] copy started …
[19:35:23] transpile started …
[19:35:32] transpile finished in 8.71 s
[19:35:32] preprocess started …
[19:35:32] preprocess finished in less than 1 ms
[19:35:32] webpack started …
[19:35:32] copy finished in 9.32 s
[19:35:56] webpack finished in 24.92 s
[19:35:56] sass started …
[19:35:58] sass finished in 1.81 s
[19:35:58] postprocess started …
[19:35:58] postprocess finished in less than 1 ms
[19:35:58] lint started …
[19:35:58] build dev finished in 35.45 s

system information:

cordova CLI: 6.4.0
Ionic Framework Version: 2.2.0
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.1.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.10.3
Xcode version: Not installed


#2

Please update your ionic lib and ionic version to Ionic 3


#3

i have try ,update to v3,but still like this…


#4

I also had this issue and i updated my app to ionic v3 and all are working fine now. Check my ionic info below:

global packages:

@ionic/cli-utils : 1.0.0
Cordova CLI      : 6.5.0
Ionic CLI        : 3.0.0

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.0.0
@ionic/cli-plugin-ionic-angular : 1.0.0
Ionic Framework                 : ionic-angular 3.2.0

System:

Node       : v6.9.2
OS         : Windows 8.1
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed

#5

thx,i will retry it ,can you give me your dependencies? pakage.json dependencies…

“dependencies”: {
"@angular/common": “2.4.8”,
"@angular/compiler": “2.4.8”,
"@angular/compiler-cli": “2.4.8”,
"@angular/core": “2.4.8”,
"@angular/forms": “2.4.8”,
"@angular/http": “2.4.8”,
"@angular/platform-browser": “2.4.8”,
"@angular/platform-browser-dynamic": “2.4.8”,
"@angular/platform-server": “2.4.8”,
"@ionic/storage": “2.0.0”,
“amqp”: “^0.2.6”,
“chart.js”: “^2.5.0”,
“cordova”: “^7.0.0”,
“ionic”: “^3.0.0”,
“ionic-angular”: “2.2.0”,
“ionic-native”: “2.4.1”,
“ionicons”: “3.0.0”,
“net”: “^1.0.2”,
“rabbit.js”: “^0.4.4”,
“rxjs”: “5.0.1”,
“stompjs”: “^2.3.3”,
“sw-toolbox”: “3.4.0”,
“zone.js”: “0.7.2”
},
“devDependencies”: {
"@ionic/app-scripts": “1.1.4”,
“typescript”: “2.0.9”
},


#6

Use my dependencies and run npm install command to update.

"dependencies": {
    "@angular/animations": "^4.0.0",
    "@angular/common": "4.1.0",
    "@angular/compiler": "4.1.0",
    "@angular/compiler-cli": "4.1.0",
    "@angular/core": "4.1.0",
    "@angular/forms": "4.1.0",
    "@angular/http": "4.1.0",
    "@angular/platform-browser": "4.1.0",
    "@angular/platform-browser-dynamic": "4.1.0",
    "@ionic-native/core": "^3.7.0",
    "@ionic-native/native-page-transitions": "^3.4.4",
    "@ionic-native/native-storage": "^3.7.0",
    "@ionic-native/splash-screen": "^3.7.0",
    "@ionic-native/status-bar": "3.7.0",
    "@ionic/storage": "2.0.1",
    "ionic-angular": "3.2.0",
    "ionicons": "3.0.0",
    "rxjs": "5.1.1",
    "sw-toolbox": "3.6.0",
    "woocommerce-api": "^1.4.2",
    "zone.js": "0.8.10"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.3.7",
    "@ionic/cli-plugin-cordova": "1.0.0",
    "@ionic/cli-plugin-ionic-angular": "1.0.0",
    "typescript": "~2.2.1"
  },

#7

some Syntax Error when i update … so i need modify too many code…
Argument of type ‘{ animate: boolean; }’ is not assignable to parameter of type ‘string’.

global packages:

@ionic/cli-utils : 1.0.0
Cordova CLI      : 6.5.0
Ionic CLI        : 3.0.0

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.0.0
@ionic/cli-plugin-ionic-angular : 1.0.0
Ionic Framework                 : ionic-angular 3.2.0

System:

Node       : v6.10.3
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed

#8

You can use:
{animate: true, direction: ‘forward’, animation: ‘ios-transition’}


#9

sorry ,i’m a newer,please help me ,follow is my code,how to modify?

let clientModal=this.modalCtrl.create(PartClassifyPage);
clientModal.onDidDismiss(data=>{
this.viewCtrl.dismiss(data,{animate:false});
});


#10

please let me know the error you are getting.


#13

--prod does not decide if you build the development or release version of the app, it only activates some build steps that optimizes your code. So from what you describe (and that is very little as you never posted the exact command you execute) you are getting exactly what you ask for.


#14


#15

Your app-script version is outdated. Can you try it again with the latest release 1.3.7? Have you forgotten to run npm install after setting the version in your package.json?

Becuase in the screenshot, you run release 1.1.4


#16

And also CLI 2.2.3 instead of 3.0.0 as in the earlier post.