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

Compatible problem with Angular 4 AOT & WebPack #52

Closed
huan opened this issue Apr 30, 2017 · 1 comment
Closed

Compatible problem with Angular 4 AOT & WebPack #52

huan opened this issue Apr 30, 2017 · 1 comment

Comments

@huan
Copy link
Owner

huan commented Apr 30, 2017

This is the reason that Brolog upgrade from v0.4 to v1.0.

You need to tell Typescript to emit CommonJS, not UMD. UMD is doing funky stuff with the require function, passing it as an argument into factory. This means webpack can't look at all usages of the top-level require function and figure out exactly what modules you're loading.
The require inside of factory is an argument, so it's different from the top-level require. They have the same name, but that's just a coincidence and webpack's static analysis knows they're not the same variable. (They store the same value at runtime, but static analysis can't figure that out)

See:
https://www.reddit.com/r/typescript/comments/4q09uv/help_webpack_weirdness_require_function_is_used/

@huan
Copy link
Owner Author

huan commented May 15, 2017

Fixed in v1.1.18

@huan huan closed this as completed May 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant