Comments (6)
@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.
This terser patch is responsible for the big speedup in some projects. Details here.
from terser-webpack-plugin.
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.
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.
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.
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)
- ng build --dev heads to Error: Optimization error [main.fe9785e49a33b769.js]: SyntaxError: Unexpected token: punc ({) HOT 4
- ES2022 - terser can not handle syntax ( SyntaxError: Unexpected token: punc ({) ) HOT 3
- esbuild minify does not produce warnings HOT 3
- plugin running jest tests with maximum number of workers in Bitbucket Pipeline - causing exceeded memory limit errors HOT 4
- Format option "quote_keys" breaks private variable syntax HOT 1
- `nth_identifier` function that accesses global scope variable crashes HOT 8
- Worker is not a constructor HOT 2
- No documentation for MangleOptions HOT 1
- The type of Rules breaks HOT 3
- Bug: minified output causes a ReferenceError HOT 4
- When use esbuildMinify tree shaking is not effect HOT 3
- Allow terser-webpack-plugin to work with Node 18+ and webpack 4 default hashes without openssl-legacy-provider HOT 3
- Updater terser to 5.20.0 HOT 5
- Dont use workers for swc & esbuild minify HOT 1
- type error after upgrade from 5.2.0 to 5.3.9 HOT 1
- Source Map is inorrect when enable extractComments.banner of terser-webpack-plugin HOT 4
- Security issue with serialize-javascript dependency HOT 1
- Minifying moves await keyword inside inlined non-async function HOT 2
- Webpack config: After TypeScript type checking 6 errors appears. HOT 1
- Behavior of minified code is altered: when dependencies have imported JSON, JSON has names mangled, uncontrollable by terser mangle options HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terser-webpack-plugin.