Skip to content

Call the runtime require function instead of the webpack's one in ns-module-factory-loader #624

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

Merged
merged 1 commit into from
Jan 31, 2017

Conversation

ivanbuhov
Copy link
Contributor

Since ns-module-factory-loader contains dynamic require call, when it is webpacked, a context module is generated for it. By default, when a module is dynamically required by a context module it must reside in the same directory as the context module in order to be resolved by the webpack's require. This means that after this change in the sdk examples, the example app will crash with Module not found when a module that is not in the same directory as ns-module-factory-loader.ts is required.
This commit makes ns-module-factory-loader "webpackable" and "snapshotable" by replacing the call to the webpack require function (webpack replaces all require(..) calls to __webpack_require(..) calls) to call to the runtime's require function.

@ivanbuhov ivanbuhov requested a review from vakrilov January 10, 2017 15:43
@hdeshev hdeshev force-pushed the buhov/snapshot-fix branch from 2729f64 to 5e63ac3 Compare January 31, 2017 09:00
@hdeshev hdeshev merged commit 4ac822d into master Jan 31, 2017
@sis0k0 sis0k0 deleted the buhov/snapshot-fix branch August 3, 2017 10:31
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

Successfully merging this pull request may close these issues.

2 participants