mikeal / ipjs

Universal JavaScript Build and Packaging
41 stars 4 forks source link

needs more documentation on how to structure ESM modules #3

Open mikeal opened 4 years ago

mikeal commented 4 years ago

it’s actually not as straightforward as it should be to structure an ESM module to work across the browser and Node.js.

since CJS was dynamic it actually did an incredible job of making a lot of different package and module structures work. ESM isn’t as flexible, so knowing how to separate out the entrypoints at the top level and using self named imports in the tests is really the only way you can make it work.