Description of the Issue
The code distributed in the lib-esm folder is not actually ES module compatible. It uses the node-specific require() syntax. While many bundlers are compatible with require, it can cause optimization bail-outs.
Looks like this was a regression which started in box-typescript-sdk-gen@19.0.1 (19.0.0 was using import/export syntax).
Steps to Reproduce
n/a
Expected Behavior
Code in lib-esm should use the import { } from './path' syntax.
Even the code from box-typescript-sdk-gen@19.0.0 was not fully ESM compatible (it did not include file extensions in import statements). A solution might be to use a rollup config that emits ESM syntax and maintains the existing src folder structure (per the glob-related suggestion in the Rollup guide: https://rollupjs.org/configuration-options/#input).
Error Message, Including Stack Trace
n/a
Screenshots
n/a
Versions Used
Typescript SDK: box-node-sdk@10.3.0
Platform: Browser
Node.js (if applicable): n/a
Description of the Issue
The code distributed in the
lib-esmfolder is not actually ES module compatible. It uses the node-specificrequire()syntax. While many bundlers are compatible withrequire, it can cause optimization bail-outs.Looks like this was a regression which started in
box-typescript-sdk-gen@19.0.1(19.0.0 was using import/export syntax).Steps to Reproduce
n/a
Expected Behavior
Code in
lib-esmshould use theimport { } from './path'syntax.Even the code from
box-typescript-sdk-gen@19.0.0was not fully ESM compatible (it did not include file extensions in import statements). A solution might be to use a rollup config that emits ESM syntax and maintains the existingsrcfolder structure (per the glob-related suggestion in the Rollup guide: https://rollupjs.org/configuration-options/#input).Error Message, Including Stack Trace
n/a
Screenshots
n/a
Versions Used
Typescript SDK:
box-node-sdk@10.3.0Platform: Browser
Node.js (if applicable): n/a