Closed pavel-krasnov closed 1 year ago
Good catch.
You can turn off minification by setting one of these properties to false: https://github.com/esbuild-kit/esbuild-loader/blob/1a758b41a850897072560f853d44a1607328a255/src/plugin.ts#L132-L136
Previously, it was called the "EsbuildMinifyPlugin". I should've also changed this default behavior when I renamed it to the generic "EsbuildPlugin".
I will change this default behavior but it will have to be in the next breaking.
Thank you, it works. Here is what I did:
// No need of this anymore.
// optimization: {
// minimize: false,
// minimizer: [
// // Use esbuild to minify
// new EsbuildPlugin({}),
// ],
// },
plugins: [
new EsbuildPlugin({
define: {
'process.env.ENV': JSON.stringify('value'),
},
// This is enough.
minifyIdentifiers: false,
}),
],
Preparing the v4 release where this is fixed. Would you mind helping test?
npm install -D 'esbuild-kit/esbuild-loader#npm/v4'
It worked without the minify option after installing the new version, thank you.
:tada: This issue has been resolved in version 4.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
@privatenumber I'm afraid now using the plugin causes bandle to not minify even in cases I want to minify.
If you can explain, please file a new issue.
I'm locking this thread as the original issue is resolved.
Bug description
npm start
and get a minified bundle under thedist
folder.optimization.minimize
tofalse
to disable Webpack minimization.npm start
and get a not minified bundle under thedist
folder.npm start
and get a minified bundle under thedist
folder.minify: false
to the plugin options constructor argument doesn't change anything.It looks like uing
EsbuildPlugin
to define values causes minification no matter what.Minimal reproduction link
https://stackblitz.com/edit/node-dawpgq
Environment
Can you contribute a fix?