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

Speed up build with improvements to the minification configuration #973

Merged
merged 5 commits into from
Jan 22, 2019
Merged

Speed up build with improvements to the minification configuration #973

merged 5 commits into from
Jan 22, 2019

Conversation

wincent
Copy link
Contributor

@wincent wincent commented Jan 22, 2019

In summary:

  • Latest webpack minor version.
  • Uglify → Terser
  • Drop low-impact optimizations.
  • Turn on caching.
  • Turn on parallel minification.

Seems like a good idea to update to the latest before the next commit,
in which I'm going to try speeding up the build by switching to Terser.
Drops the build from 38s to 36s.
Two things going on here:

1. Turning off things with small gains based on this list:

    https://github.com/vuejs/vue-cli/blob/4ebf6700a403ca3c8e39387684acff6fca3632ac/packages/%40vue/cli-service/lib/config/terserOptions.js

2. Switching from plug-in style to built-in `optimization` → `minimizer`
   style; surprisingly, this one seemed to have the biggest impact.

With these, we go from 38s to 27s, and the build size doesn't change
prohibitively:

  Before:

   874084 alloy-editor-all-min.js
   273571 alloy-editor-core-min.js
   383670 alloy-editor-no-ckeditor-min.js
   764321 alloy-editor-no-react-min.js

  After:

   881701 alloy-editor-all-min.js
   278273 alloy-editor-core-min.js
   389525 alloy-editor-no-ckeditor-min.js
   770769 alloy-editor-no-react-min.js

Post-gzip, those size changes boil down to effectively nothing.
With this, first build is 27s, second build is 15s.
As documented here:

https://github.com/webpack-contrib/terser-webpack-plugin

This doesn't seem to make things appreciably faster though; maybe a
second at most, but still, I'll take it.
@wincent wincent requested a review from julien January 22, 2019 16:18
@julien
Copy link
Contributor

julien commented Jan 22, 2019

Just started reviewing :)

:octocat: Sent from GH.

@julien
Copy link
Contributor

julien commented Jan 22, 2019

@wincent great!

@julien julien merged commit bb76108 into liferay:2.x-develop Jan 22, 2019
@wincent wincent deleted the terser branch January 24, 2019 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants