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

Use uglifyjs-webpack-plugin ^1.0.1 to optimize the supervisor code #524

Merged
2 commits merged into from Nov 9, 2017

Conversation

pcarranzav
Copy link
Contributor

@pcarranzav pcarranzav commented Nov 9, 2017

We've been using UglifyJS 0.4.6 (the webpack default) so far, but this doesn't support ES6 and some dependency
updates are starting to cause builds to break (e.g. request/request#2772, which also happens to break
my builds in the multicontainer branch).

Here we switch to the latest uglifyjs-webpack-plugin which is designed for ES2015 support.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez pablo@resin.io

Edited: originally this PR meant to use babel-minify instead of the newer uglifyjs, hence Page's comments below.

Copy link
Contributor

@Page- Page- left a comment

Choose a reason for hiding this comment

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

Is there any reason you didn't use 1.x of uglifyjs-webpack-plugin? That should support uglify-es: https://github.com/webpack-contrib/uglifyjs-webpack-plugin/blob/master/CHANGELOG.md

@pcarranzav
Copy link
Contributor Author

@Page- webpack by default depends on uglifyjs-webpack-plugin ^0.4.6, so to be able to use the newer one we'd have to use a forked webpack. See: webpack/webpack#3673

@Page-
Copy link
Contributor

Page- commented Nov 9, 2017

I'm pretty sure you can do it by adding the 1.x version to package.json and using the plugin via

var UglifyJSPlugin = require('uglifyjs-webpack-plugin')
...
plugins: [
	...
	new UglifyJSPlugin()
]

Mainly I'm just wondering if uglifyjs will give better results, and it should also hopefully be closer to what we currently do

We've been using UglifyJS 0.4.6 (the webpack default) so far, but this doesn't support ES6 and some dependency
updates are starting to cause builds to break (e.g. request/request#2772, which also happens to break
my builds in the multicontainer branch).

Here we switch to the latest uglifyjs-webpack-plugin which is designed for ES2015 support.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
@pcarranzav pcarranzav changed the title Use babel-minify to optimize the supervisor code Use uglifyjs-webpack-plugin ^1.0.1 to optimize the supervisor code Nov 9, 2017
@pcarranzav
Copy link
Contributor Author

@Page- thanks, that worked! I had tried it before and it hadn't worked but I guess I must've done something wrong.

@ghost ghost merged commit f9f0f22 into master Nov 9, 2017
@ghost ghost deleted the uglify-es6 branch November 9, 2017 04:45
This pull request was closed.
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.

None yet

2 participants