3 ms·
Reading through the Webpack2 release tags I came across the v2.1.0-beta28 changelog, which mentions: > * add `import()` as Code Splitting construct. It should
by julenx 10y ago
Reading through the Webpack2 release tags I came across the v2.1.0-beta28 changelog, which mentions:
> * add `import()` as Code Splitting construct. It should be used instead of `System.import` when possible. `System.import` will be deprecated in webpack 2 release (removed in webpack 3) as it's behavior is incorrect according to the spec.
I was under the impression `System.import` would be the new way to do code splitting and hence supersede `require.ensure()`. After further checking, now it seems like the function-like `import()` will be used instead [1], which is better accepted in browsers than `System.import()`.
[0] https://github.com/webpack/webpack/releases/tag/v2.1.0-beta.28 https://github.com/webpack/webpack/releases/tag/v2.1.0-beta....
[1] https://github.com/webpack/webpack/issues/3098 https://github.com/webpack/webpack/issues/3098