Open vdias38 opened 6 years ago
Also tested with following command
$ npm run ionic:build --prod --env prod
[17:50:53] lint finished in 31.39 s
> meu-starter.ionic-v3@0.0.1 ngsw-config /Users/victor/Dvpt/PROJECTS/ion-employee
> ngsw-config www src/ngsw-config.json
> meu-starter.ionic-v3@0.0.1 ngsw-copy /Users/victor/Dvpt/PROJECTS/ion-employee
> cp node_modules/@angular/service-worker/ngsw-worker.js www/ "prod"
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory
npm ERR! code ELIFECYCLE
npm ERR! errno 64
npm ERR! meu-starter.ionic-v3@0.0.1 ngsw-copy: `cp node_modules/@angular/service-worker/ngsw-worker.js www/ "prod"`
npm ERR! Exit status 64
npm ERR!
npm ERR! Failed at the meu-starter.ionic-v3@0.0.1 ngsw-copy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/victor/.npm/_logs/2018-10-05T16_51_03_716Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 64
npm ERR! meu-starter.ionic-v3@0.0.1 ionic:build: `ionic-app-scripts build && npm run ngsw-config && npm run ngsw-copy "prod"`
npm ERR! Exit status 64
npm ERR!
npm ERR! Failed at the meu-starter.ionic-v3@0.0.1 ionic:build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Also tried following cli but when I check www/build/main.js
always find ion-employee-int
$ npm run ionic:build --env=prod --prod
> meu-starter.ionic-v3@0.0.1 ionic:build /Users/victor/Dvpt/PROJECTS/ion-employee
> ionic-app-scripts build && npm run ngsw-config && npm run ngsw-copy
...
[19:07:57] webpack started ...
Using PROD environment variables for PROD build.
Loading ./src/environments/environment.prod.ts
[19:07:57] copy finished in 28.73 s
...
$ npm run ionic:build -- --env=prod --prod
> meu-starter.ionic-v3@0.0.1 ionic:build /Users/victor/Dvpt/PROJECTS/ion-employee
> ionic-app-scripts build && npm run ngsw-config && npm run ngsw-copy "prod"
...
[19:31:46] webpack started ...
Using PROD environment variables for PROD build.
Loading ./src/environments/environment.prod.ts
[19:31:48] copy finished in 35.86 s
...
> meu-starter.ionic-v3@0.0.1 ngsw-copy /Users/victor/Dvpt/PROJECTS/ion-employee
> cp node_modules/@angular/service-worker/ngsw-worker.js www/ "prod"
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory
npm ERR! code ELIFECYCLE
npm ERR! errno 64
npm ERR! meu-starter.ionic-v3@0.0.1 ngsw-copy: `cp node_modules/@angular/service-worker/ngsw-worker.js www/ "prod"`
npm ERR! Exit status 64
$ ionic build --env=prod --prod
npm run ionic:build -- --prod --env prod ionic-app-scripts build && npm run ngsw-config && npm run ngsw-copy "--prod" "--env" "prod" Using DEFAULT environment variables for PROD build. Loading ./src/environments/environment.ts
$ npm run ionic:build --env=prod --prod
ionic-app-scripts build && npm run ngsw-config && npm run ngsw-copy Using PROD environment variables for PROD build. // BUT NOT when I check www/build/main.js always find ion-employee-int Loading ./src/environments/environment.prod.ts
If I do a grep on www/build/main.js I can see that both env files are concat
{apiKey:"AIzaSyBemLnl_Wz4U50lD3gXirvjDk5jLUbyA_M",**authDomain:"ion-employee-int.firebaseapp.com**",databaseURL:"https://ion-employ
ee-int.firebaseio.com",projectId:"ion-employee-int",storageBucket:"ion-employee-int.appspot.com",mes
sagingSenderId:"236514035211"},[]),s._12(256,S.d,void 0,[]),s._12(256,Q.a,"/",[]),s._12(256,b.l,"XSRF-TOKEN",[]),s._12(256,b.m,"X-XSRF-TOKEN",[]),s._12(256,O.a,_,[]),s._12(256,p.m,void 0,[]),s._12(256,p.l,void 0,[])])})},56:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var i={production:!0,isDebugMode:!1,analyticsTrackingId:"UA-113326323-1",meumobi:{apiUrl:"https://meumobi.com"},imgServer:{url:"https://imageflow.meumobi.com/",sources:{firebase:{prefix:"https://infomobi.page.link"},meumobi:{prefix:"/uploads"}}},dynamicLinks:{url:"https://firebasedynamiclinks.googleapis.com/v1/shortLinks",prefix:"https://infomobi.page.link"},youtube:{apiKey:"AIzaSyAD49q_weB67bZX8u95G9zrXmBULqdMzas"},firebase:{apiKey:"AIzaSyBnCsnH9XAtG73lIwRuYj4dbXLyPBv0E5I",**authDomain:"ion-employee.firebaseapp
.com**",databaseURL:"https://ion-employee.firebaseio.com",projectId:"ion-employee",storageBucket:"ion-
employee.appspot.com",messagingSenderId:"961286969528"}}}
The behavior is unstable, implementation recommended on blog post works well BUT not on app.module
. I've commented this behavior on ionic issue
Expected behaviour
Tell us what should happen
Actual behaviour
If I build with
$ npm run ionic:build --prod --env=prod
it uses DEV envUsing DEFAULT environment variables for PROD build.
If I build with
$ ionic build --prod --env=prod
it raises following errorSteps to reproduce
1. 2. 3.
Expected responses