Promise.all creates multiple chunks

What is the current behavior?

I’m using webpack 2.2.0-rc.4, following code creates two separate chunks.

Promise.all([
  import('./routes/Home'),
  import('./routes/Home/reducers'),
]).then(...)

What is the expected behavior?

Only create one chunk like what require.ensure(['./routes/Home', './routes/Home/reducers']) does.

How to achieve that using import?

Author: Fantashit

1 thought on “Promise.all creates multiple chunks

  1. Best advice would be to create a module which imports them both, and then import that file. That way they can be imported together from one file in one chunk.

Comments are closed.