Commit Graph

48 Commits

Author SHA1 Message Date
Sean Larkin dc315e5f6d feat(uglify): move uglify to external plugin from webpack-contrib 2017-06-07 12:35:50 -05:00
Stephen Hurwitz 87702a29ad Updates UglifyJs to 2.8.x to accept additional compress options
Bumps the minimum version of UglifyJs and substitutes `.compress()` for
`.transform()` as recommended. In addition to a new test covering
`compress` options this commit also contains updates to make existing
tests pass with the update.
2017-03-04 18:31:39 -08:00
Sebastian Schweizer d2461dab06 improve code (review) 2017-02-10 23:16:20 +01:00
Sebastian Schweizer 71933e979e UglifyJsPlugin: extract comments to separate file
License comments use up a lot of space, especially when using many small
libraries with large license blocks. With this addition, you can extract
all license comments to a separate file and remove them from the bundle
files. A small banner points to the file containing all license
information such that the user can find it if needed.

We add a new option extractComments to the UglifyJsPlugin.
It can be omitted, then the behavior does not change, or it can be:
- true: All comments that normally would be preserved by the comments
    option will be moved to a separate file. If the original file is
    named foo.js, then the comments will be stored to foo.js.LICENSE
- regular expression (given as RegExp or string) or a function
  (astNode, comment) -> boolean: All comments that match the given
    expression (resp. are evaluated to true by the function) will be
    extracted to the separate file. The comments option specifies
    whether the comment will be preserved, i.e. it is possible to
    preserve some comments (e.g. annotations) while extracting others or
    even preserving comments that have been extracted.
- an object consisting of the following keys, all optional:
  - condition: regular expression or function (see previous point)
  - file: The file where the extracted comments will be stored. Can be
      either a string (filename) or function (string) -> string which
      will be given the original filename. Default is to append the
      suffix .LICENSE to the original filename.
  - banner: The banner text that points to the extracted file and will
      be added on top of the original file. will be added to the
      original file. Can be false (no banner), a string, or a function
      (string) -> string that will be called with the filename where
      extracted comments have been stored. Will be wrapped into comment.
      Default: /*! For license information please see foo.js.LICENSE */
2017-02-10 11:59:56 +01:00
Tobias Koppers be4f27c51d Merge pull request #4200 from timse/allow-to-supress-uglifyjs-warnings
Allow to supress uglifyjs warnings
2017-02-09 14:08:01 +01:00
Tim Sebastian 1d78f990a6 use const where applicable in UglifyJsPlugin 2017-02-05 12:20:22 +11:00
Tim Sebastian 92364dc0f7 avoid reassigning stream with different value in UglifyJsPlugin 2017-02-05 12:20:22 +11:00
Tim Sebastian 104398f87a avoid reassigning files with different value in UglifyJsPlugin 2017-02-05 12:20:21 +11:00
Tim Sebastian e107cc598a allow to filter uglify warnings by adding option "warningsFilter"
only works if "sourceMap" setting is true
2017-02-05 01:37:10 +11:00
Adam Markon 879adef6c7 refactor UglifyJSPlugin to ES6 class (#3717) 2017-01-03 23:53:37 -06:00
James Hartig 0676304822 Pass mangle options to ast.figure_out_scope in uglify 2016-12-16 16:19:06 -05:00
Duncan Beevers e7a06a79e2 Log original and mapped filename+line+column on uglify error 2016-08-03 21:35:57 -05:00
Tobias Koppers 7fdfdbd43b correct linting 2016-06-16 01:05:17 +02:00
Tobias Koppers ffd2d37efd changed defaults for uglifyjsplugin, no source mapping, no warnings 2016-05-29 12:17:59 +02:00
Tobias Koppers c501b5d5af fixed #2011 2016-02-08 09:54:13 +01:00
hh9527 1021faf13c Fix #1983 : Object properties can be mangle now.
Use the following config:

```js
{
  plugins: [
    new webpack.optimize.UglifyJsPlugin({
        mangle: {
          props: {
            regex: /_$/
          },
        },
      }),
  ]
}
```
2016-02-08 09:52:10 +01:00
Kenny Tran eebc5ceaf6 Fix no-redeclare in code 2016-01-18 18:57:42 -08:00
Tobias Koppers ded70aef28 moves stuff from webpack-core to webpack-sources 2015-12-29 17:44:55 +01:00
Tobias Koppers 67656b90e2 split uglify-js from loader minimize, better shortcut defaults 2015-11-16 23:11:15 +01:00
Sanghvi 6c3cd7750c Fix indentation in uglifyjs change 2015-10-12 18:34:13 -07:00
Sanghvi d1600176bd Reset uglify's base54 counters for each file 2015-10-12 16:47:49 -07:00
Alberto Leal 4024689e63 Stronger check and override of comments in UglifyJsPlugin options
Fixes https://github.com/webpack/webpack/issues/324
2015-07-26 21:26:27 -04:00
Tobias Koppers f7d799adb4 rebeautify without spacing after keyword 2015-07-16 00:19:23 +02:00
Avi Haiat 0a340f2b1a feat(app): Beautify all lib files 2015-07-13 01:20:09 +03:00
Tobias Koppers cebd3b9722 added linting 2015-04-23 23:55:50 +02:00
Tobias Koppers 92f53176a2 use sourceAndMap is available 2015-04-03 12:38:56 +02:00
Sebastien Barre 9cbce108f1 Factorize code with UglifyJSPlugin 2015-03-20 14:00:39 -04:00
Antti Ahti 5d107999d5 Show error messages from UglifyJs
Print out err.msg if it's available. Previously these error messages were ignored and it printed unhelpful "undefined"
2015-02-21 11:29:53 +02:00
Tobias Koppers 6779ddb076 allow to disable SourceMap in UglifyJsPlugin 2014-10-31 12:46:18 +01:00
berni 836aac7b51 use test, include and exclude options as suggested by @sokra 2014-10-30 11:29:33 +01:00
berni 15448f16e9 add ability to skip files via user-defined function 2014-10-29 23:35:24 +01:00
Tobias Koppers 8bbc81f635 typo 2014-10-10 09:10:06 +02:00
Tobias Koppers 2d3b2dc4f7 uglify .js with query string
fixes webpack/react-starter#9
2014-10-10 07:35:00 +02:00
Tobias Koppers e489cce1af fixes webpack/extract-text-webpack-plugin#15 2014-09-15 13:33:13 +02:00
Tobias Koppers 3597cdb149 Stack trace for critical UglifyJs errors 2014-07-26 13:59:30 +02:00
syranide 3f20c27302 Support any UglifyJS OutputStream option {output: {...}} 2014-05-13 23:13:25 +02:00
Tobias Koppers 3170b76b22 webpack 1.0 beta
moved many options to plugins
#113
2013-12-17 23:21:49 +01:00
Tobias Koppers a395c07c5d report better errors for uglify-js 2013-12-17 00:53:22 +01:00
Tobias Koppers d8dbc5e602 less code 2013-12-13 09:47:18 +01:00
Tobias Koppers c9331d93d3 fixed location info for minimizing 2013-10-31 00:06:39 +01:00
Tobias Koppers 672fc9ba0f UglifyJsPlugin: don't drop warnings
warnings are mapped by source map to modules
2013-09-14 11:50:39 +02:00
Tobias Koppers 6045abca76 allow to disable mangling 2013-07-11 00:16:07 +02:00
Tobias Koppers b5b672233f Fixed caching 2013-07-04 11:55:37 +02:00
Tobias Koppers 49506c83bb HOT: added update json info file, fixed infinite hash updates, #26 2013-07-01 13:59:02 +02:00
Tobias Koppers 72f29bf81c move minimize option to plugin 2013-05-12 22:44:10 +02:00
Tobias Koppers 8d0162c7bb small change in webpack-core 2013-03-28 08:42:53 +01:00
Tobias Koppers 0de7c73ad8 SourceMap support 2013-03-26 16:54:41 +01:00
Tobias Koppers 8ecdb72b48 removed old files, moved stuff 2013-02-01 08:42:12 +01:00