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

Adding ES Module Support with Backward Compatibility for AMD #87

Merged
merged 8 commits into from
Oct 23, 2023

Conversation

lohitakshgupta
Copy link
Collaborator

@lohitakshgupta lohitakshgupta commented Sep 29, 2023

This PR adds support for ES Modules while ensuring backward compatibility with AMD modules. rollup is being used for the build process here. Details:

  1. rollup.config.js generates the same set of files that were being generated by buildpackage.js earlier. It's modern and easy to use when it comes to supporting multiple modules. The only extra file that gets generated is SDK.js.map which is actually helpful for debugging purposes. Please see the comments in the code file to understand the folder structure. Essentially, it adds AMD content to the package root (ensuring backward compatibility) and ESM content to an esm folder. License, README.md, SECURITY.md and package.json files are added to the package root as well.
  2. tsconfig.amd.json extends existing tsconfig.json to support AMD modules.
  3. tsconfig.esm.json extends existing tsconfig.json to support ESM modules.

Relevant issues addressed:
#66
#58
#56

package-lock.json Outdated Show resolved Hide resolved
@dpaquette
Copy link

Let's add the engine properties to package.json to specify which version of node/npm we should be using to build this project.

https://docs.npmjs.com/cli/v6/configuring-npm/package-json#engines

@lohitakshgupta lohitakshgupta merged commit c4d112c into master Oct 23, 2023
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants