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

Babili no longer working with webpack 3.0.0 #590

Closed
bradennapier opened this issue Jun 20, 2017 · 3 comments
Closed

Babili no longer working with webpack 3.0.0 #590

bradennapier opened this issue Jun 20, 2017 · 3 comments

Comments

@bradennapier
Copy link

bradennapier commented Jun 20, 2017

As of webpack 3 this appears to no longer work. I thought it was a few other things but I have narrowed it down to babili breaking arg spreading.

I have updated everything to the latest.

const r = Object.keys(selected).reduce((...args) => {
    console.log(args.length); // 4
    handleProcessReduction(selected, ...args);
  }, {});

function handleProcessReduction(selected, ...args) {
  console.log('p: ', args.length); // 1
} 

I can see it is not doing the right thing:

return Object.keys(e).reduce(function() {
            for (var r = arguments.length, t = Array(r), n = 0; n < r; n++)
              t[n] = arguments[n];
            console.log(t.length), u.apply(void 0, [e, t]); // [e, t] not [e].concat(t)?
          }, {});

My babel config is just default

babel: {
    plugins: ['transform-class-properties'],
    presets: [
      'stage-0',
      [
        'env',
        {
          modules: false,
        },
      ],
    ],
    env: {
      production: {
        presets: ['babili'],
      },
      test: {
        plugins: ['istanbul'],
        sourceMaps: 'inline',
      },
    },
  },
@bradennapier bradennapier changed the title Babili no longer working Babili no longer working with webpack 3.0.0 Jun 20, 2017
@bradennapier
Copy link
Author

bradennapier commented Jun 20, 2017

It works perfectly in the reply which adds to the annoyance here haha

I'm sure it's something stupid I am doing but I can't imagine what - this is an extremely simple setup.

Switching to uglify fixes this:

return Object.keys(e).reduce(function() {
            for (var r = arguments.length, t = Array(r), n = 0; n < r; n++)
              t[n] = arguments[n];
            return console.log(
              'reduction: ',
              t,
              t.length,
            ), u.apply(void 0, [e].concat(t));
          }, {});

@goto-bus-stop
Copy link
Contributor

Yeah, this one has been biting a lot of people—it's fixed on master by #578, but not yet released!

@vigneshshanmugam
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants