'is this a normal structure to deploy as an npm package?

I usually work on standalone React apps but I'm currently working on a component that will need to be distributed as an npm package. I watched a youtube vid that walked me through one way of creating a dist folder. At the end of the vid, the dist folder had the following contents:

  • index.es.js
  • index.js

Questions:

  • Does this reflect the standard file names for an npm dist folder?
  • What is the difference between these 2 files, as the file names seem to reflect different versions of the same thing?
  • Should both of these file types always be included?

I don't think the vid included configuring the module bundler to include the app's project.json file. Although based on what I've read, it looks like a package.json file is needed in order to install the dist directory as a local npm package. Is a package.json file optional in some scenarios? Or is it best practice to always configure the bundler to include a package.json file?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source