Skip to content
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

feat(build): add sourcemap option #3113

Merged
merged 2 commits into from
Nov 17, 2016

Conversation

filipesilva
Copy link
Contributor

@filipesilva filipesilva commented Nov 11, 2016

Add --no-sourcemap option to ng build/serve/test.

Disabling sourcemaps can help with build speeds. My tests on a medium project show a 11.5% improvement on initial builds, and a 37% improvement on rebuilds.

Disabling sourcemaps will make debugging harder, since it makes line information very innacurate.

Partially address #1980

Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but travis failing.

open?: boolean;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this empty line, please.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@clydin clydin mentioned this pull request Nov 14, 2016
Add `--no-sourcemap` option to `ng build/serve/test`.

Disabling sourcemaps can help with build speeds. My tests on a medium project shoul a 11.5% improvement on initial builds, and a 37% improvement on rebuilds.

Disabling sourcemaps will make debugging harder, since it makes line information very innacurate.

Partially address angular#1980
@filipesilva filipesilva merged commit 6f9d2c1 into angular:master Nov 17, 2016
@filipesilva filipesilva deleted the sourcemap-option branch November 17, 2016 14:47
@naveedahmed1
Copy link

Should disabling sourcemaps also reduce the bundle size? I am using lazy loading and with --prod and --aot options the total size of all bundles is ~14mb with one of the bundles (0.xxxxxxxx.bundle.js) having size of ~8mb. The build process takes 20 minutes.

Mischi pushed a commit to BROCKHAUS-AG/angular-cli that referenced this pull request Nov 19, 2016
Add `--no-sourcemap` option to `ng build/serve/test`.

Disabling sourcemaps can help with build speeds. My tests on a medium project shoul a 11.5% improvement on initial builds, and a 37% improvement on rebuilds.

Disabling sourcemaps will make debugging harder, since it makes line information very innacurate.

Partially address angular#1980
@naveedahmed1
Copy link

@filipesilva I just tried no-sourcemap using below command ng build --aot --prod --no-sourcemap, the total bundles size which was 14mb with previous version, is now 38.3 mb though the build which previousl took 20 minutes is now very quick.

@grizzm0
Copy link
Contributor

grizzm0 commented Nov 23, 2016

@filipesilva Isn't sourcemap only used for dev/debug purposes?

My main.bundle.js.gz went from 301kb to 720kb with --no-sourcemap. More than double in size.

@rerickson1
Copy link

I see an increase in my bundle size if I use the --no-sourcemap option as well.
With ng build --prod --aot main.bundle.js is 825 KB, main.bundle.js.gz is 173 KB.
With ng build --prod --aot --no-sourcemap main.bundle.js is 2,837 KB, main.bundle.js.gz is 448 KB.
That's a 3.43 or 2.58 times increase when using the --no-sourcemap option. It looks like I would be better off using the --no-sourcemap option in production because my pages will load faster.

@filipesilva
Copy link
Contributor Author

@naveedahmed1 @grizzm0 @rerickson1 my bad, fix in #3262

@naveedahmed1
Copy link

naveedahmed1 commented Nov 27, 2016

@filipesilva I tried angular-cli: 1.0.0-beta.21 and with ng build --aot --prod --no-sourcemap I am still getting the total bundles size of 38.4Mb while if I dont use the --no-sourcemap, the size of the generated bundles is 14.3Mb.

@filipesilva
Copy link
Contributor Author

@naveedahmed1 #3262 has been merged but will only be out in the next release.

MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this pull request Feb 9, 2017
Add `--no-sourcemap` option to `ng build/serve/test`.

Disabling sourcemaps can help with build speeds. My tests on a medium project shoul a 11.5% improvement on initial builds, and a 37% improvement on rebuilds.

Disabling sourcemaps will make debugging harder, since it makes line information very innacurate.

Partially address angular#1980
@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 11, 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 this pull request may close these issues.

6 participants