Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

feat: Uglify-es support for quantum #884

Merged
merged 3 commits into from Oct 23, 2017
Merged

Conversation

bsl-zcs
Copy link
Contributor

@bsl-zcs bsl-zcs commented Oct 19, 2017

I asked at gitter for the best way to design an API for it, but got no reply. So here is the simplest implementation possible, though it probably isn't very straightforward to use.

It picks up uglify's options from the UglifyESPlugin or could be triggered by quantum option uglify: { es6: true }

@@ -24,6 +24,11 @@ export class QuantumPluginClass implements Plugin {
// remove uglify js
delete plugins[index];
}
if (plugin.constructor.name === "UglifyESPluginClass") {
this.coreOpts.uglify = { es6:true, ...plugin.options };
Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I remember UglifyEs5 will complain about an unknown option. When passing the option, let's make sure es6 :true is not there (delete it)

It would great if you added documentation for that here:
https://github.com/fuse-box/fuse-box/blob/master/docs/quantum.md#installation

Good job!

Copy link
Contributor Author

@bsl-zcs bsl-zcs Oct 20, 2017

Choose a reason for hiding this comment

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

It got extracted later on via parameter destructuring here: { es6 = false, ...opts }

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, can you add the docs please?

@bsl-zcs
Copy link
Contributor Author

bsl-zcs commented Oct 23, 2017

Well, I hope it's comprehensible. :)

Copy link
Contributor

@nchanged nchanged left a comment

Choose a reason for hiding this comment

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

👍 thanks a lot!

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.

None yet

2 participants