Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Deliver an esm version #192

Open
jehon opened this issue Jun 2, 2021 · 4 comments
Open

Deliver an esm version #192

jehon opened this issue Jun 2, 2021 · 4 comments

Comments

@jehon
Copy link

jehon commented Jun 2, 2021

Nodejs and the browser now fully support the "import ... / export ... " syntax.

Will this package be migrated to?

@bnjmnt4n
Copy link
Member

bnjmnt4n commented Jun 2, 2021

Right now, platform.js is a written with CommonJS, so there might not be much benefits in terms of just providing a ESM version, although I might look into that in the future. An ESM version also isn't likely to improve tree-shaking.

@julianpoemp
Copy link

Angular warns users about commonjs packages and says that it could lead to optimization bailouts.

It would be nice to have platformjs as es6 module. E.g. you could convert the project to a Typescript  project and build it with rollup.js. After that you get a commonjs ( and a minified version) and a es6 module automatically. @bnjmnt4n please have a look on my tsrollupjs-sample project. It's very easy to migrate and Typescript is easy to learn.

@raiyni
Copy link

raiyni commented Jun 27, 2021

ESM version would be beneficial for svelte users, otherwise this library can't be used there.

@Dinika
Copy link

Dinika commented Apr 4, 2023

Are there any updates on this? I wanted to use this for a react project in my team and not having an esm version makes it difficult.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

5 participants