privatenumber / esbuild-loader

💠 Speed up your Webpack with esbuild ⚡️
MIT License
3.58k stars 106 forks source link

docs: Added minify:true to EsbuildPlugin #335

Closed Alex-Sokolov closed 1 year ago

Alex-Sokolov commented 1 year ago

After last update (https://github.com/esbuild-kit/esbuild-loader/pull/333) needed to explicit turn on minification

privatenumber commented 1 year ago

It doesnt if its passed into optimization.

Are you experiencing different behavior?

Alex-Sokolov commented 1 year ago

I use production config with mode: 'production'. And webpack runs optimizations for you depending on the chosen mode. Before update I got minified files automatically, after update files not minified when building for production until I add minify to EsbuildPlugin. I think that needed be clarified in docs

privatenumber commented 1 year ago

Sounds like a bug.

See the tests for expected behavior.

Would you mind sharing your configuration to demonstrate the behavior you're setting?

privatenumber commented 1 year ago

Here's the base repro template from the Bug report form.

You can see that the distribution is minified despite minify: true not being passed in: https://stackblitz.com/edit/node-guv65j?file=dist%2Fmain.js&view=editor

Closing for now but feel free to provide more information or file a bug report if you can reproduce it.

Alex-Sokolov commented 1 year ago

Thanks for template!

Finally after work have a time to make a repro :) @privatenumber could you take a look? https://stackblitz.com/edit/node-bexr5c?file=dist%2Fmain.js

When use esbuild-loader@3.1.0

Снимок экрана 2023-08-18 в 23 24 04

When use esbuild-loader@4.0.0

Снимок экрана 2023-08-18 в 23 24 26
privatenumber commented 1 year ago

Thanks, I've verified. This isn't really a bug but it's an inaccuracy caused by webpack-merge duplicating objects.

Will fix soon.

Next time, please start by filing an issue.