Skip to content

Angular dependency injection broken in minified files #631

@josencv

Description

@josencv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions