Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define property prevents bundle from minifying #337

Closed
2 tasks
pavel-krasnov opened this issue Aug 29, 2023 · 1 comment · Fixed by #338
Closed
2 tasks

Define property prevents bundle from minifying #337

pavel-krasnov opened this issue Aug 29, 2023 · 1 comment · Fixed by #338
Labels
bug Something isn't working

Comments

@pavel-krasnov
Copy link

Problem

Given the provided template, I run npm start and get a minified bundle under the dist folder.

  • I add the following to replace values in the bundle:
new EsbuildPlugin({
  define: {
    'process.env.ENV': JSON.stringify('value'),
  },
}),
  • I run npm start and get a not minified bundle under the dist folder.

It looks like using EsbuildPlugin to define values prevents minification no matter what.

Expected behavior

The bundle is minified when I use EsbuildPlugin with define.

Minimal reproduction URL

https://stackblitz.com/edit/node-gme7l3

Version

4.0.0

Node.js version

16.20.0

Package manager

npm

Operating system

Linux

Contributions

  • I plan to open a pull request for this issue
  • I plan to make a financial contribution to this project
@privatenumber
Copy link
Owner

Thanks, and good catch!

Really appreciate the reproduction. Fix coming soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants