Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distribute a ES2017 build #488

Open
tomwayson opened this issue Mar 14, 2021 · 1 comment
Open

distribute a ES2017 build #488

tomwayson opened this issue Mar 14, 2021 · 1 comment

Comments

@tomwayson
Copy link
Member

tomwayson commented Mar 14, 2021

At first, in each package we would:

  • transpile TS to ES2017 along side the ESM ES5 (at publish time only as we are doing w/ the UMD build in streamline UMD builds #487)
  • add a new (non-standard) es2017 field to package.json that points to the location of the ES2017 build (i.e. keep module field pointing to ESM ES5

This would allow us to distribute ES2017 but not point to it as the default module build, allowing end users to opt into using the es2017, w/o requiring a breaking change. This is along the lines of what Stencil.js packages do.

We could later improve upon this by adding an exports field to package.json, but we still need to do a bit of research to figure out the best way to do that for all the targets/environments we support (also see the webpack docs on exports).

Finally, at some later point, as part of some major version release, we can make ES2017 the default module build once we decide that will work for the browsers and node versions we want to support "out of the box." We can at that time choose to continue distributing ESM ES5 and UMD builds also.

@tomwayson
Copy link
Member Author

FYI - looks like even node 10 supports E2107 so I guess there's no need to wait on behalf of the supported node environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant