Giter Club home page Giter Club logo

Comments (6)

alexander-akait avatar alexander-akait commented on June 16, 2024 23

@anton164 Thanks! Unfortunately performance are not exists. I heard about increase perf from many developers. Looks guys from terser do great job. And yes it is expected, don't worry 😄

webpack@5 will use terser plugin by default.

My recommendation is switch to terser plugin ASAP.

from terser-webpack-plugin.

kzc avatar kzc commented on June 16, 2024 4

This terser patch is responsible for the big speedup in some projects. Details here.

from terser-webpack-plugin.

alexander-akait avatar alexander-akait commented on June 16, 2024

Also uglify plugin right now use uglify-es (this package is abandoned and contains a lot of bugs). New version uglify plugin switch back to uglify-js (webpack-contrib/uglifyjs-webpack-plugin#352) and it is should to fix these bugs and increase perf also, but uglify-js doesn't support ES6 code.

from terser-webpack-plugin.

anton164 avatar anton164 commented on June 16, 2024

Great, thanks! That gives me the confidence to proceed :)

Will add some more performance tests once I get a hold of them

from terser-webpack-plugin.

edmorley avatar edmorley commented on June 16, 2024

Hi!

After seeing this, I tried comparing terser-webpack-plugin and uglifyjs-webpack-plugin and there was no noticeable speed-up caused by switching for the project I tested it against.

Is it possible there were other differences in config/environment?

For example, the default webpack configuration using uglifyjs-webpack-plugin also sets sourcemap: true if appropriate (which would presumably take longer than if not enabled):
https://github.com/webpack/webpack/blob/3366421f1784c449f415cda5930a8e445086f688/lib/WebpackOptionsDefaulter.js#L308-L314

Also, the new webpack-sources v1.2.0 contains a significant performance improvement (webpack/webpack-sources#32), and whilst both uglifyjs-webpack-plugin and terser-webpack-plugin have a dependency on webpack-sources@^1.1.0 (whose range is satisfied by 1.2.0), I was wondering if your lockfile when trying the former might have been still on 1.1.0 rather than 1.2.0 (since installing the new package might have given the transient dependencies a refresh)?

That said, terser-webpack-plugin is definitely preferred given it's maintained and has many more correctness fixes - so even if there aren't performance improvements (yet), it's worth switching.

from terser-webpack-plugin.

anton164 avatar anton164 commented on June 16, 2024

Here's my config, which does include source maps:

      new TerserPlugin({
        sourceMap: true,
        parallel: true,
        cache: './.build_cache/terser',
        exclude: /transpiledLibs/,
        terserOptions: {
          warnings: false,
          ie8: false
        }
      })

I am again experiencing issues, so you're proabably right @edmorley. I believe my issue is related to webpack-contrib/uglifyjs-webpack-plugin#272, however it doesn't happen consistently, and the issue with long builds seems to resurface in CircleCI.

It's a large bundle, so creating a minimum reproducible test case isn't straight forward.

from terser-webpack-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.