You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 1, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on May 1, 2020. It is now read-only.
If I understood this right, moduleFiles are all files that are used by the project. But when running production mode this list will be shrinked to the files the are imported directly by a script.
To verify this I add a log console.log('webpack.js after', context.moduleFiles && context.moduleFiles.length); to line 112 in webpack.ts#L112 with --prod webpack.js after 381 without --prod webpack.js after 663
And based on this you are trying to resolve all scss files you will need to import?! But most of the components are just used in the html files without being imported in any script. So trying to resolve the scss files based on the moduleFiles will not work. Thats should be the commit that introduce the issue.
Reacted by Bengt Weiße, Richard, Gustav Bylund and Hsin-lin Cheng
@DavidWiesner, that is very helpful. Here's a work-around that works for me.
My problem is that the style of an ion-segment inside an ion-item is messed up. I use the same component in another project and there it works fine. With the inspector I saw that Ionic inserts an ion-label in the ion-item which lacks the proper styles.
I looked at context.moduleFiles and saw that the label module wasn't included. In my other project which works, it is included. The project that worked used ion-label in one of its templates while the other didn't.
I added the following in a template and now it works.
I still can't found a solution. There all ok with ionic cordova build android, all styles work fine. And zero styles when ionic cordova build android --prod --release.
Not found what was happen with prod but found a life hack that solve problem with the build size and speed of Android app. Use next command to build app:
I have faced same CSS issue when I build with --prod and --release arguments ionic cordova build android --prod --release
I found my @ionic/app-scripts version was 2.1.4 and it has some problem. So I upgraded it to latest version 3.0.0 and tried, it worked!.
running ionic build --aot --minifyjs --minifycss && cordova run android --release with or without the --optimizejs flag and running ionic cordova run android --release --aot --minifyjs --minifycss
Strangely enough, if I don't run with the --release flag it seems to work... What the --release flag does under the hood?
Activity
danbucholtz commentedon Jul 14, 2017
@squallliu,
Please do not delete our form. You are missing a good amount of required data.
How can I recreate this issue? Please upload a sample repository.
Thanks,
Dan
squallliu commentedon Jul 14, 2017
@danbucholtz
styles are missing
lordgreg commentedon Jul 14, 2017
I can confirm this issue as well.
as soon as remove the
--prodflag, the styling looks okay.MarkChrisLevy commentedon Jul 16, 2017
@danbucholtz I can confirm this as well.
vkniazeu commentedon Jul 18, 2017
The issue is NOT present with "@ionic/app-scripts": "^2.0.0".
vkniazeu commentedon Jul 18, 2017
#1120 is related.
lordgreg commentedon Jul 18, 2017
@vkniazeu I've just checked your statement with 2.0.2 version installed and it still produced the same issue.
danbucholtz commentedon Jul 19, 2017
@squallliu,
I'll test your project out and verify. It could be a Windows thing. Though I did test some apps on windows. Hmmm.
Thanks,
Dan
bsummersgb commentedon Jul 19, 2017
I'm also experiencing this on OSX
squallliu commentedon Jul 19, 2017
@danbucholtz
vkniazeu commentedon Jul 19, 2017
@lordgreg,
2.0.2does give me an error. It's2.0.0that works fine for me. FWIW, I'm on Windows.danbucholtz commentedon Jul 19, 2017
@squallliu and others,
I can recreate the issue in @squallliu's sample project. I noticed that it has the following config setting:
Are you all using this setting as well? If I remove this setting, everything works as expected.
Thanks,
Dan
lordgreg commentedon Jul 19, 2017
HI Dan,
I don't have this setting at all:
danbucholtz commentedon Jul 19, 2017
@lordgreg,
Can you check your
package.json? How can I recreate with your project set-up?Thanks,
Dan
35 remaining items
lordgreg commentedon Sep 13, 2017
Hi @KillerCodeMonkey, @summerchill, this is my command:
ionic cordova build android --release --prod --aot -- -- --keystore.........and the ionic info:
KillerCodeMonkey commentedon Sep 14, 2017
strange - does not work for me.
But there are only a view styles missing, like when i use ion-grid in ion-item. the widths are not correctly set.
Edit: if i set ion-label explicit to width 100%, everything looks fine *thinking
Also styles like:
.label-md { margin: 13px 8px 13px 0; }are missing or the wholeion-labelcss block is missingDavidWiesner commentedon Sep 14, 2017
@danbucholtz here is my list of context.moduleFiles. For readability i only list the once for ionic-angular.
Log for ionic serve with
--prodBut when run serve without
--prodIf I understood this right,
moduleFilesare all files that are used by the project. But when running production mode this list will be shrinked to the files the are imported directly by a script.To verify this I add a log
console.log('webpack.js after', context.moduleFiles && context.moduleFiles.length);to line 112 in webpack.ts#L112with --prod
webpack.js after 381without --prod
webpack.js after 663And based on this you are trying to resolve all scss files you will need to import?! But most of the components are just used in the html files without being imported in any script. So trying to resolve the scss files based on the moduleFiles will not work. Thats should be the commit that introduce the issue.
Richie765 commentedon Sep 17, 2017
@DavidWiesner, that is very helpful. Here's a work-around that works for me.
My problem is that the style of an
ion-segmentinside anion-itemis messed up. I use the same component in another project and there it works fine. With the inspector I saw that Ionic inserts anion-labelin theion-itemwhich lacks the proper styles.I looked at
context.moduleFilesand saw that the label module wasn't included. In my other project which works, it is included. The project that worked usedion-labelin one of its templates while the other didn't.I added the following in a template and now it works.
damroyan commentedon Sep 18, 2017
Any updates on this topic?
I still can't found a solution. There all ok with ionic cordova build android, all styles work fine. And zero styles when ionic cordova build android --prod --release.
`
ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
global packages:
local packages:
System:
damroyan commentedon Sep 19, 2017
UPD:
Not found what was happen with prod but found a life hack that solve problem with the build size and speed of Android app. Use next command to build app:
ionic cordova build android --release --aot --minifyjs --minifycssIdrimi commentedon Sep 29, 2017
npm install @ ionic/app-scripts @latest --save-dev
worked for me
https://github.com/ionic-team/ionic-app-scripts/blob/master/CHANGELOG.md
loganadhan-palanisamy commentedon Oct 5, 2017
I have faced same CSS issue when I build with --prod and --release arguments
ionic cordova build android --prod --releaseI found my
@ionic/app-scriptsversion was 2.1.4 and it has some problem. So I upgraded it to latest version 3.0.0 and tried, it worked!.marcosmlopes commentedon Oct 9, 2017
Same issue here. I tried the following solutions without success:
ionic build --aot --minifyjs --minifycss && cordova run android --releasewith or without the--optimizejsflag and runningionic cordova run android --release --aot --minifyjs --minifycssStrangely enough, if I don't run with the
--releaseflag it seems to work... What the--releaseflag does under the hood?ionic info:
package.json
danbucholtz commentedon Oct 13, 2017
Is this still an issue with
3.0.0?Thanks,
Dan
sebaferreras commentedon Oct 14, 2017
I was not able to reproduce it anymore @danbucholtz, so seems to be fixed on my end.
DavidWiesner commentedon Oct 16, 2017
@danbucholtz update ionic-app-scripts 3.0.0 fix the issue in my case
niconaso commentedon Oct 18, 2017
@danbucholtz yes! it's still happening, you can reproduce it with ionic-conference-app
mikeCm14 commentedon Oct 30, 2017
Any update on this issue?
niconaso commentedon Oct 30, 2017
@Heckthor yes! It's fixed in the final version 😃