johannesjo / angular2-promise-buttons

Chilled loading buttons for angular2
https://johannesjo.github.io/angular2-promise-buttons/#demo
MIT License
86 stars 28 forks source link

Angular v9 (ivy) compatibility #27

Closed petebacondarwin closed 4 years ago

petebacondarwin commented 4 years ago

Currently this package cannot be processed correctly by ngcc (Angular's ivy compatibility compiler) because the package.json contains "module": "index.js" property. This means that applications targeting the ivy renderer in Angular 9 (the default) will not be able to use this library.

This property is supposed to be used for ES6 code (i.e. stuff that uses ES modules) but index.js contains CommonJS formatted code.

The "main" property, which also exists in the package.json is the correct one to use for index.js.

Could you remove the "module" property from the published package.json, or update the build to also generate ES6 as well and point this property at that file?


In the meantime projects using this package and targeting ivy can workaround the problem with an `ngcc.config.js file in their project root containing:

module.exports = {
  packages: {
    'angular2-promise-buttons': {
      entryPoints: { '.': { override: { module: undefined } } }
    }
  }
};
johannesjo commented 4 years ago

Thank you very much for making me aware of this issue. I'll provide a patch soon.