8000 Make UglifyJsPlugin optional/configurable · Issue #79 · symfony/webpack-encore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Make UglifyJsPlugin optional/configurable #79

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

Closed
allfreelancers opened this issue Jul 3, 2017 · 5 comments
Closed

Make UglifyJsPlugin optional/configurable #79

allfreelancers opened this issue Jul 3, 2017 · 5 comments

Comments

@allfreelancers
Copy link

HI!
// todo - options here should be configurable
new webpack.optimize.UglifyJsPlugin({
sourceMap: this.webpackConfig.useSourceMaps
})

Can you make it optional/configurable? I have an error:
app.b452c69496e2c9f0cbd2.js from UglifyJs

@stof
Copy link
Member
stof commented Jul 3, 2017

what is the error message you get ?

@allfreelancers
Copy link
Author

Error :
app.8eaba82891470d4ca570.js from UglifyJs
Unexpected token: punc (() [app.8eaba82891470d4ca570.js:204,8]

The solution of the problem is possible:
webpack/webpack#1542

@stof
Copy link
Member
stof commented Jul 3, 2017

yeah, UglifyJS currently does not support minifying ES6 code. You need to transpile it to ES5 with Babel first.

weaverryan added a commit that referenced this issue Jul 25, 2017
This PR was squashed before being merged into the master branch (closes #99).

Discussion
----------

Refactor plugin configuration

Extract encore built in plugin configuration logic into plugin utils.

First step toward allowing to be able to configure plugins through options and have more modular integration for plugins inside encore. From now on only public API with proper options is needed,
for most cases.

This changes are internals and tries to improve plugin architecture inside encore. Please take a look on it and feedback are welcome :). So far I see improvements for several issues:

* #2 - Point .2 ...for plugins we should do the same as for loaders, from point of view of module split (utilities).
* #63 - Better (more modular) integration of the plugin as well its configuration.
* #65 - Same as #63
* #79 - Now it should be possible to pass options and/or check for flags to apply plugin or not.
* #87 - Some small steps to make clean plugin more configurable. Public API still need to be changed though.

thanks in advance.

Commits
-------

65adfdc Refactor plugin configuration
@weaverryan
Copy link
Member

Closing - see #139 also for more details

@Goatfried
Copy link

For anyone else that comes here looking for a solution:
If you use babel-preset-env, set the option targets.uglify to true in your babel presets.

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

No branches or pull requests

4 participants
0