export ESM code
"module" is a non-standard field that Node.js doesn't read. It uses "exports".
ESM code also needs the .mjs file extension.
https://nodejs.org/api/packages.html#determining-module-system
Do you know if this syntax is supported by FE tooling like Webpack 4/5, Rollup, esbuild, parcel etc?
It's from Node v12 https://nodejs.org/en/blog/release/v12.7.0 so almost everything should support it by now.
Webpack 5 added support in 2020. https://webpack.js.org/blog/2020-10-10-webpack-5-release/ so version 4 didn't have it.
Rollup definitely has it. https://github.com/rollup/plugins/issues/208#issuecomment-1162367570 Since at least node-resolve v11. https://github.com/rollup/plugins/pull/540