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

Update Webpack to v2.2.1; update other npm modules #1108

Merged
merged 1 commit into from
Feb 1, 2017

Conversation

frenzzy
Copy link
Member

@frenzzy frenzzy commented Jan 31, 2017

continues #1093
also fixes #1047 #1021 #954

@frenzzy frenzzy merged commit a55d311 into kriasoft:master Feb 1, 2017
@frenzzy frenzzy deleted the webpack branch February 1, 2017 10:30
const Admin = await new Promise((resolve) => {
require.ensure([], (require) => resolve(require('./Admin').default), 'admin');
});
const Admin = await require.ensure([], require => require('./Admin').default, 'admin');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this preferred over system.import statement? Are they any different?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on #901

...waiting for chunk name solution before upgrading to webpack v2.

Is System.import in webpack v2 already support chunk name ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Webpack 2 Code Splitting

  1. Note on the deprecated System.import: webpack's use of System.import didn't fit the proposed spec, so it was deprecated in v2.1.0-beta.28 in favor of import()
  2. Caveat: require.ensure allows for easy chunk naming with the optional third argument, but import API doesn't offer that capability yet. If you want to keep that functionality, you can continue using require.ensure.

So, if you don't care about chunk name you can just use import here

const Admin = await import('./Admin').default;

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

Successfully merging this pull request may close these issues.

Error: Server terminated unexpectedly with code: null signal: SIGTERM
4 participants