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

[v1.2.5] ionic-app-scripts build ios prod too slowly #875

Closed
novboy opened this issue Apr 6, 2017 · 5 comments
Closed

[v1.2.5] ionic-app-scripts build ios prod too slowly #875

novboy opened this issue Apr 6, 2017 · 5 comments

Comments

@novboy
Copy link

novboy commented Apr 6, 2017

Short description of the problem:

after upgrade to version 1.2.5, it is too slow to build ios platform in prod mode

What behavior are you expecting?

Steps to reproduce:
1.package.json :
"scripts": { "build": "ionic-app-scripts build", "watch": "ionic-app-scripts watch", "serve:before": "watch", "emulate:before": "build", "deploy:before": "build", "build:before": "build", "run:before": "build", "clean": "ionic-app-scripts clean", "ionic:build": "ionic-app-scripts build", "ionic:serve": "ionic-app-scripts serve" },
2.run command
ionic build ios --release --prod
3.The build process is blocked after uglifyjs finished, but it will finish after a few hours. see logs below:
`
[10:28:02] lint finished in 39.63 s

teapot@ ionic:build /Users/ahoo/Documents/workspace/teapot/app
ionic-app-scripts build "--release" "--prod"

[10:28:11] ionic-app-scripts 1.2.5
[10:28:11] build prod started ...
[10:28:11] clean started ...
[10:28:11] clean finished in 15 ms
[10:28:11] copy started ...
[10:28:11] ngc started ...
[10:30:36] ngc finished in 145.08 s
[10:30:36] preprocess started ...
[10:30:36] deeplinks started ...
[10:30:46] deeplinks finished in 9.55 s
[10:30:46] optimization started ...
[10:30:46] optimization finished in 53 ms
[10:30:46] preprocess finished in 9.61 s
[10:30:46] webpack started ...
[10:31:57] copy finished in 225.94 s
[10:34:52] webpack finished in 246.45 s
[10:34:53] sass started ...
[10:34:53] transpile bundle started ...
[10:37:01] transpile bundle finished in 127.92 s
[10:37:01] uglifyjs started ...
[10:37:21] sass finished in 148.37 s
[10:37:21] cleancss started ...
[10:41:55] uglifyjs finished in 294.24 s`

insert any relevant code between the above and below backticks

Which @ionic/app-scripts version are you using?
1.2.5
`"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",
"@angular/tsc-wrapped": "0.5.1",
"@ionic/storage": "2.0.1",
"ionic-angular": "2.3.0",
"ionic-native": "2.9.0",
"ionicons": "3.0.0",
"ng2-translate": "5.0.0",
"rxjs": "5.0.1",
"zone.js": "0.7.2",
"intl": "1.2.5",
"sw-toolbox": "^3.4.0",
"localforage": "1.4.3",
"localforage-cordovasqlitedriver": "1.5.0"
},
"devDependencies": {
"@ionic/app-scripts": "1.2.5",

    "reflect-metadata": "0.1.9",
    "typescript": "^2.1.5"
},
"cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "ionic-plugin-keyboard"
],
"cordovaPlatforms": [
    "ios",
    {
        "platform": "ios",
        "version": "1.0",
        "locator": "ios"
    }
],`

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

@danbucholtz
Copy link
Contributor

Hi @zhihuwang,

How big is your app? How many files are in it? Can you share the repo? I don't really have anything to go off of here.

What sort of specs does your computer have? Do you have an SSD?

Thanks,
Dan

@novboy
Copy link
Author

novboy commented Apr 6, 2017

@danbucholtz thank you for reply, The project is not very large, and it is not hosted in github. Yes I have a SSD, 8G RAM,old version I7 CPU the computer is not powerful. I do not known what is the process doing, there is nothing output after 'uglifyjs finished in 294.24 s' until now. about 90% cpu is used by node, and cpu time is 1:26, thread is 10.
ahoo-mac:app ahoo$ du -sh *
4.0K README.md
4.0K config.xml
4.0K ionic.config.json
422M node_modules
4.0K package.json
239M platforms
41M plugins
728K resources
5.4M src
4.0K teapot-release-key.keystore
4.0K tsconfig.json
4.0K tslint.json
21M www
ahoo-mac:app ahoo$ cd src
ahoo-mac:src ahoo$ du -sh *
24K app
4.8M assets
4.0K declarations.d.ts
4.0K index.html
4.0K manifest.json
88K model
348K pages
64K providers
4.0K service-worker.js
16K theme
ahoo-mac:src ahoo$ cd assets/
ahoo-mac:assets ahoo$ du -sh *
0B html
16K i18n
4.0K icon
4.8M img

@novboy
Copy link
Author

novboy commented Apr 6, 2017

why cleancss spend so much time?
[10:37:21] cleancss started ...
[10:41:55] uglifyjs finished in 294.24 s

[12:36:08] cleancss finished in 7126.81 s
[12:36:08] postprocess started ...
[12:36:08] postprocess finished in 103 ms
[12:36:08] lint started ...
[12:36:08] build prod finished in 7676.58 s

@danbucholtz
Copy link
Contributor

It is very likely due to the colors array being very large. How many items do you have in that within the sass? This is a known issue that we need a solution for. Your CSS file is likely gigantic.

Thanks,
Dan

@danbucholtz
Copy link
Contributor

Dupe of #506,

Let's track it there.

Thanks,
Dan

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants