This PR adds support for ES Modules while ensuring backward compatibility with AMD modules. rollup is being used for the build process here. Details:
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.
tsconfig.amd.json extends existing tsconfig.json to support AMD modules.
tsconfig.esm.json extends existing tsconfig.json to support ESM modules.
This PR adds support for ES Modules while ensuring backward compatibility with AMD modules.
rollup
is being used for the build process here. Details:rollup.config.js
generates the same set of files that were being generated bybuildpackage.js
earlier. It's modern and easy to use when it comes to supporting multiple modules. The only extra file that gets generated isSDK.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 anesm
folder. License, README.md, SECURITY.md and package.json files are added to the package root as well.tsconfig.amd.json
extends existingtsconfig.json
to support AMD modules.tsconfig.esm.json
extends existingtsconfig.json
to support ESM modules.Relevant issues addressed:
66
58
56