Giter VIP home page Giter VIP logo

Comments (7)

privatenumber avatar privatenumber commented on June 6, 2024 1

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.

from esbuild-loader.

pavel-krasnov avatar pavel-krasnov commented on June 6, 2024 1

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,
  }),
],

from esbuild-loader.

privatenumber avatar privatenumber commented on June 6, 2024 1

Preparing the v4 release where this is fixed. Would you mind helping test?

npm install -D 'esbuild-kit/esbuild-loader#npm/v4'

from esbuild-loader.

pavel-krasnov avatar pavel-krasnov commented on June 6, 2024

It worked without the minify option after installing the new version, thank you.

from esbuild-loader.

privatenumber avatar privatenumber commented on June 6, 2024

🎉 This issue has been resolved in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

from esbuild-loader.

pavel-krasnov avatar pavel-krasnov commented on June 6, 2024

@privatenumber I'm afraid now using the plugin causes bandle to not minify even in cases I want to minify.

from esbuild-loader.

privatenumber avatar privatenumber commented on June 6, 2024

If you can explain, please file a new issue.

I'm locking this thread as the original issue is resolved.

from esbuild-loader.

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.