feat: ease webpack configuration and add support Node ESM by tbouffard · Pull Request #867 · maxGraph/maxGraph

@tbouffard

Previously, maxGraph integration in a webpack build required the addition of a specific configuration.
Imports into maxGraph code did not include the “js” extension required by webpack for import resolution. A workaround was needed in the configuration, otherwise an error would occur.
For the same reason, Node.js emitted an error when importing maxGraph into ESM scripts or applications. No workaround was available.

All imports into maxGraph ESM code provided in the npm package now include the “js” extension, which corrects both past problems.
A new eslint plugin has been added to reinforce the “js” extension. It provides an automatic correction for the corresponding rule.
The webpack and Node ESM examples in this repository have been updated to demonstrate the new behavior.