Skip to content

ng build outfile very big, how to mini #994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Jun 3, 2016 · 5 comments
Closed

ng build outfile very big, how to mini #994

ghost opened this issue Jun 3, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented Jun 3, 2016

win32 64bit
angular2
ng build

directory vendor size 16.3 MB

tree vendor

├─@angular
│  ├─common
│  │  ├─esm
│  │  │  ├─src
│  │  │  │  ├─directives
│  │  │  │  ├─facade
│  │  │  │  ├─forms
│  │  │  │  │  └─directives
│  │  │  │  ├─location
│  │  │  │  └─pipes
│  │  │  └─testing
│  │  ├─src
│  │  │  ├─directives
│  │  │  ├─facade
│  │  │  ├─forms
│  │  │  │  └─directives
│  │  │  ├─location
│  │  │  └─pipes
│  │  └─testing
│  ├─compiler
│  │  ├─esm
│  │  │  ├─src
│  │  │  │  ├─expression_parser
│  │  │  │  ├─facade
│  │  │  │  ├─output
│  │  │  │  ├─schema
│  │  │  │  └─view_compiler
│  │  │  └─testing
│  │  ├─src
│  │  │  ├─expression_parser
│  │  │  ├─facade
│  │  │  ├─output
│  │  │  ├─schema
│  │  │  └─view_compiler
│  │  └─testing
│  ├─core
│  │  ├─esm
│  │  │  ├─src
│  │  │  │  ├─change_detection
│  │  │  │  │  └─differs
│  │  │  │  ├─debug
│  │  │  │  ├─di
│  │  │  │  ├─facade
│  │  │  │  ├─linker
│  │  │  │  ├─metadata
│  │  │  │  ├─profile
│  │  │  │  ├─reflection
│  │  │  │  ├─render
│  │  │  │  ├─testability
│  │  │  │  ├─util
│  │  │  │  └─zone
│  │  │  └─testing
│  │  ├─src
│  │  │  ├─change_detection
│  │  │  │  └─differs
│  │  │  ├─debug
│  │  │  ├─di
│  │  │  ├─facade
│  │  │  ├─linker
│  │  │  ├─metadata
│  │  │  ├─profile
│  │  │  ├─reflection
│  │  │  ├─render
│  │  │  ├─testability
│  │  │  ├─util
│  │  │  └─zone
│  │  └─testing
│  ├─http
│  │  ├─esm
│  │  │  ├─src
│  │  │  │  ├─backends
│  │  │  │  └─facade
│  │  │  └─testing
│  │  ├─src
│  │  │  ├─backends
│  │  │  └─facade
│  │  └─testing
│  ├─platform-browser
│  │  ├─esm
│  │  │  ├─src
│  │  │  │  ├─animate
│  │  │  │  ├─browser
│  │  │  │  │  ├─location
│  │  │  │  │  └─tools
│  │  │  │  ├─dom
│  │  │  │  │  ├─debug
│  │  │  │  │  └─events
│  │  │  │  ├─facade
│  │  │  │  └─security
│  │  │  └─testing
│  │  ├─src
│  │  │  ├─animate
│  │  │  ├─browser
│  │  │  │  ├─location
│  │  │  │  └─tools
│  │  │  ├─dom
│  │  │  │  ├─debug
│  │  │  │  └─events
│  │  │  ├─facade
│  │  │  └─security
│  │  └─testing
│  ├─platform-browser-dynamic
│  │  ├─esm
│  │  │  ├─src
│  │  │  │  ├─facade
│  │  │  │  └─xhr
│  │  │  └─testing
│  │  ├─src
│  │  │  ├─facade
│  │  │  └─xhr
│  │  └─testing
│  ├─router
│  │  ├─esm
│  │  │  ├─src
│  │  │  │  ├─directives
│  │  │  │  ├─facade
│  │  │  │  └─metadata
│  │  │  └─testing
│  │  ├─src
│  │  │  ├─directives
│  │  │  ├─facade
│  │  │  └─metadata
│  │  └─testing
│  └─router-deprecated
│      ├─esm
│      │  └─src
│      │      ├─directives
│      │      ├─facade
│      │      ├─lifecycle
│      │      ├─route_config
│      │      └─rules
│      │          ├─route_handlers
│      │          └─route_paths
│      └─src
│          ├─directives
│          ├─facade
│          ├─lifecycle
│          ├─route_config
│          └─rules
│              ├─route_handlers
│              └─route_paths
├─@angular2-material
│  ├─button
│  ├─card
│  ├─checkbox
│  ├─core
│  │  ├─annotations
│  │  ├─async
│  │  ├─gestures
│  │  ├─live-announcer
│  │  ├─overlay
│  │  │  └─position
│  │  ├─portal
│  │  └─rtl
│  ├─grid-list
│  ├─icon
│  ├─input
│  ├─list
│  ├─progress-bar
│  ├─progress-circle
│  ├─radio
│  ├─sidenav
│  └─toolbar
├─bootstrap
│  ├─dist
│  │  ├─css
│  │  └─js
│  │      └─umd
│  └─grunt
├─es6-shim
├─jquery
│  └─dist
├─ng2-cookies
│  └─src
│      └─services
├─ng2-resource-rest
├─reflect-metadata
│  └─temp
│      └─test
│          └─reflect
├─rxjs
│  ├─add
│  │  ├─observable
│  │  │  └─dom
│  │  └─operator
│  ├─bundles
│  ├─observable
│  │  └─dom
│  ├─operator
│  ├─scheduler
│  ├─src
│  ├─symbol
│  ├─testing
│  └─util
├─systemjs
│  └─dist
├─tether
│  └─dist
│      ├─css
│      └─js
└─zone.js
    └─dist
@aciccarello
Copy link
Contributor

Try setting the environment variable to enable a production build. See #41 for more on the production build.

#987 also has some proposals on production build features.

@filipesilva
Copy link
Contributor

@aciccarello is right - ng build -prod will give you a bundled, tree shaken and minimized build.

@ghost
Copy link
Author

ghost commented Jun 4, 2016

thank you @aciccarello , @filipesilva very much

i used ,but i got an error, could you help me? thank you again

#1002

@prithviraju1369
Copy link

@filipesilva when i do ng build -prod --aot, vendor bundle file size is still 1.4mb, can't we reduce the size further ?

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants