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

Build 2x faster #393

Closed
wants to merge 1 commit into from
Closed

Build 2x faster #393

wants to merge 1 commit into from

Conversation

zpao
Copy link
Member

@zpao zpao commented Sep 26, 2015

I was testing some fbjs changes and got tired of waiting ~23s for each build so I made it faster.

  1. Removed duplicate modules task. We already run it for dist and dist:min (where it gets deduped) so we don't need to run it before then.

    (saves ~5s)

  2. Removed the babel webpack loader. We've already transformed our code. fbjs is already transformed. We shouldn't need to transform again. There are some differences (https://gist.github.com/zpao/16e13b4a85010c6fbdff) as a result of this - mostly because we don't reprint, though there are also a couple 'use strict' statements missing but that's probably ok.

    (saves ~6-7s for each dist and dist:min but they run in parallel so only see the win once)

I ran a few times before and after to get some stable numbers with a warm disk cache. I dropped from 23s to 12s.

loaders: [
{test: /\.js$/, loader: 'babel'}
],
},
Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I'll come clean…

The real reason I found this was because I couldn't build relay after making changes to fbjs because babel didn't like transforming the code it generated and I got this:

ERROR in Loader /Users/poshannessy/FB/code/fbjs/node_modules/babel/index.js didn't return a function
 @ ../fbjs/lib/fetchWithRetries.js 26:27-60

@kassens
Copy link
Member

kassens commented Sep 26, 2015

Thanks!

@facebook-github-bot import

@facebook-github-bot
Copy link
Contributor

Thanks for importing. If you are an FB employee go to https://our.intern.facebook.com/intern/opensource/github/pull_request/888826177831498/int_phab to review.

@ghost ghost closed this in d6ee51f Sep 26, 2015
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants