Skip to content

Switch to uglifyjs-webpack-plugin #1119

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

Merged
merged 1 commit into from
Dec 2, 2017

Conversation

sudo-suhas
Copy link
Contributor

@sudo-suhas sudo-suhas commented Nov 28, 2017

Summary

This switches to uglifyjs-webpack-plugin for minification which uses UglifyJS v3 (uglify-es) to minify javascript.

Why is this required

Right now, we use babel-preset-env with some browser versions as the target. This dynamic config may break minification because currently the uglify plugin shipped in webpack 2 doesn't support ES6+. For example, if I change my target.browsers to ["last 2 Chrome versions", "last 2 Firefox versions"] it will break uglify. Since this template is meant to be customised by developers, it would be better to have a more robust method for minification.

Also see discussion in vuejs-templates/pwa#44. If this PR is approved here, I'll make a PR to the pwa template as well.

@LinusBorg
Copy link
Contributor

How does this compare to babel-minify? Any experience with both?

@sudo-suhas
Copy link
Contributor Author

I had tried babel-minify a few months back and the bundle size was slightly larger.

@LinusBorg LinusBorg merged commit c408224 into vuejs-templates:develop Dec 2, 2017
@LinusBorg
Copy link
Contributor

Thanks

LinusBorg added a commit that referenced this pull request Dec 2, 2017
* develop:
  bump version 1.2.5
  some small updates to the docs
  Adds support for the video poster attribute (#1123)
  babel-register use only for e2e tests (#1120)
  Update project creation: sort dependencies in package.json (#1118)
  Fix bug from PR #1082
  FIX: convert env variable PORT to a number.
  Minor refactoring of build scripts (#1082)
  ESLint config clean up (#1093)
  Switch to uglifyjs-webpack-plugin (#1119)
  change bad spaces into normal spaces and removing trailing space (#1132)
  prevent empty line when unit = y & e2e = n
  Update meta.js (#1091)
  docs(README): Update usage to init from develop branch (#1092)
  Use actual host for notification (#1101). (#1103)
  prevent webpack from injecting useless mocks
@sudo-suhas sudo-suhas deleted the uglifyjs-plugin branch December 3, 2017 02:32
frandiox pushed a commit to OnsenUI/vue-cordova-webpack that referenced this pull request Dec 25, 2017
shenron pushed a commit to shenron/webpack that referenced this pull request Mar 20, 2018
shenron pushed a commit to shenron/webpack that referenced this pull request Mar 20, 2018
* develop:
  bump version 1.2.5
  some small updates to the docs
  Adds support for the video poster attribute (vuejs-templates#1123)
  babel-register use only for e2e tests (vuejs-templates#1120)
  Update project creation: sort dependencies in package.json (vuejs-templates#1118)
  Fix bug from PR vuejs-templates#1082
  FIX: convert env variable PORT to a number.
  Minor refactoring of build scripts (vuejs-templates#1082)
  ESLint config clean up (vuejs-templates#1093)
  Switch to uglifyjs-webpack-plugin (vuejs-templates#1119)
  change bad spaces into normal spaces and removing trailing space (vuejs-templates#1132)
  prevent empty line when unit = y & e2e = n
  Update meta.js (vuejs-templates#1091)
  docs(README): Update usage to init from develop branch (vuejs-templates#1092)
  Use actual host for notification (vuejs-templates#1101). (vuejs-templates#1103)
  prevent webpack from injecting useless mocks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants