PatrickJS / angular-hmr

:fire: Angular Hot Module Replacement for Hot Module Reloading
https://patrickjs.com
Apache License 2.0
506 stars 45 forks source link

npm package 1.2.2 content does match github content #47

Open mike-packetwerk opened 7 years ago

mike-packetwerk commented 7 years ago

Inside 1.2.2 https://registry.npmjs.org/@angularclass/hmr/-/hmr-1.2.2.tgz src/helpers.ts

// Hot Module Replacement
export function bootloader(main: any) {
  if (document.readyState === 'complete') {
    main()
  } else {
    document.addEventListener('DOMContentLoaded', main);
  }
}

On github: https://github.com/AngularClass/angular2-hmr/blob/master/src/helpers.ts#L1

Looks like the packaging system is broken?

sallar commented 7 years ago

Im having the exact problem. This is breaking on iOS9 and some Android devices, while the Github content don't break when I copy them over. for now Im going to patch this manually until a new release goes out.

This line doesn't fire:

document.addEventListener('DOMContentLoaded', main);

While this works:

document.addEventListener('DOMContentLoaded', () => main());