While browsing through the code, I found some IE11-specific code. Since IE11 is not a supported browser anymore (by model-viewer's README), nor by three.js, I think this code can be refactored to more modern code. This change leads to a somewhat smaller bundle size.
If I understand correctly this is not just for IE11, but for any browser that does not support ES Modules. The specific lines were introduced in https://github.com/google/model-viewer/commit/92111b3ac68c22508bc00edb6300404407308008. Since all modern / supported browsers support ES6 Modules (caniuse), I doubt if the UMD bundles are still required. I do not see any usage of the umd bundles in the repository itself (e.g. in the aforementioned unit test build).
Because I am not sure, I did not touch the rollup config.
Description
While browsing through the code, I found some IE11-specific code. Since IE11 is not a supported browser anymore (by model-viewer's README), nor by three.js, I think this code can be refactored to more modern code. This change leads to a somewhat smaller bundle size.
Bundle size
File size after a
npm run build
:Testing
npm run test
succeeds on my local machine.UMD bundles
In the rollup config I found this code:
https://github.com/google/model-viewer/blob/99fa9a8ba5c31ba161880f8b82248a196759dee4/packages/model-viewer/rollup.config.js#L73-L83
If I understand correctly this is not just for IE11, but for any browser that does not support ES Modules. The specific lines were introduced in https://github.com/google/model-viewer/commit/92111b3ac68c22508bc00edb6300404407308008. Since all modern / supported browsers support ES6 Modules (caniuse), I doubt if the UMD bundles are still required. I do not see any usage of the umd bundles in the repository itself (e.g. in the aforementioned unit test build).
Because I am not sure, I did not touch the rollup config.