So you'd need to add rollup and rollup-plugin-commonjs to your devDependencies, adjust the input/output paths (you may prefer the osmtogeojson.mjs node preference suffix), and add a npm build script for "rollup -c "
You can also add
"module": "<path to osmtogeojson.mjs>",
to package.json (under the "main" property is good) so that CDNs like unpkg.com can find it with the "?module" flag.
I use this rollup in my all-module repo for osmtogeojson now for in-browser use and it seems to work .. I'll get back to you if I discover any problems.
You can convert the repo to es6 later if you'd like, using rollup to create a UMD (good for both node require() and browser script tag) from your es6 module. It would be a non-breaking change if you keep the file names the same.
This is a request for an es6 module version of osmtogeojson.
Fortunately, rather than porting the index.js to es6, rollup, with a cjs plugin, does the trick!
This config file will convert osmtogeojson to an es6 module:
So you'd need to add rollup and rollup-plugin-commonjs to your devDependencies, adjust the input/output paths (you may prefer the osmtogeojson.mjs node preference suffix), and add a npm build script for "rollup -c"
You can also add
I use this rollup in my all-module repo for osmtogeojson now for in-browser use and it seems to work .. I'll get back to you if I discover any problems.
You can convert the repo to es6 later if you'd like, using rollup to create a UMD (good for both node require() and browser script tag) from your es6 module. It would be a non-breaking change if you keep the file names the same.