10000 Angular dependency injection broken in minified files · Issue #631 · nervgh/angular-file-upload · GitHub
[go: up one dir, main page]

Skip to content

Angular dependency injection broken in minified files #631

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

Closed
josencv opened this issue May 11, 2016 · 3 comments
Closed

Angular dependency injection broken in minified files #631

josencv opened this issue May 11, 2016 · 3 comments

Comments

@josencv
Copy link
Collaborator
josencv commented May 11, 2016

The issue is very straighforward. The angular dependencies are broken in the minified version of the library (v2.2.3).

I investigated a little and it looks like this is not a problem of the uglifier webpack plugin.

The problems lies in convertion from ES6 to ES5, that is, babel iseltf. From version 6.0 and above the code:

export default (args) => {
 ...
}

transforms into:

exports.default = function (args) {
  ...
}

instead of:

module.exports = function (args) {
  ...
}

The angular modules injection are explicit, but they are using common js module syntax:

module.exports.$inject = ['args'];

So the dependencies are being injected to a wrong target, causing the whole problem.

The solution involves a change in the design of the whole module, so I think @nervgh should decide how to solve this.

This article explains in depth the problem and the posible solutions.

@nervgh
Copy link
Owner
nervgh commented May 11, 2016

@josencv thanks! Fixed in v2.3.1 😄

@nervgh nervgh closed this as completed May 11, 2016
@josencv
Copy link
Collaborator Author
josencv commented May 11, 2016

Thanks for the quick fix. Now works without problems.

@nervgh
Copy link
Owner
nervgh commented May 12, 2016

You are welcome! Thank you for the informative issue!

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

No branches or pull requests

2 participants
0