Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

116
Views
Why is Webpack minification breaking this function parameter destructuring?

This works without minification.

export function distributionBy(options: DistributionOptions): LayoutFunction {
  const {dimension} = options;
  return layout(
    ({
      nodes,
      initial,
      channels: {
        initial: {
          [dimension]: { domain },
        },
      },
    }): LayoutResult => {
      const { bin, dimension, reverse, spread } = options;

Here is the minified code

function Jh(e){const{dimension:t}=e;return fd((({nodes:t,initial:n,channels:{initial:{[a]:{domain:r}}}})=>{const{bin:i,dimension:a,reverse:s,spread:u}=e

Note that the inner-most "dimension" variable is renamed to "a", which is referenced in fd's parameter destructuring. When the minified code runs, [a] resolves to [undefined] which isn't what I want at all. I think it should be [t], defined in the top most scope (inside Jh).

Can any Webpack pros offer some insight?

My workaround is to do [options.dimension], which resolves correctly.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!