masonry-layout icon indicating copy to clipboard operation
masonry-layout copied to clipboard

@appnest/masonry-layout doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module

Open hrishikesh-k opened this issue 2 years ago • 0 comments

Hi!

Thank you so much for your work on this library! It works really well!

I've run into a small issue. Till now, I was using this in a Hugo website, but just started converting that into a Astro website. I currently have a very simply component like:

---
---
<masonry-layout>
  <h1>Masonry</h1>
</masonry-layout>
<script>
  import '@appnest/masonry-layout'
</script>

However, the build gives a warning:

@appnest/masonry-layout doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix

Seems like a straightforward change to convert this to a module (by adding the declaration in package.json). So, I've submitted a PR. Let me know if it makes sense!

I didn't find any reference of module field in package.json here: https://docs.npmjs.com/cli/v9/configuring-npm/package-json, so I have simply converted that to "type": "module" instead.

hrishikesh-k avatar Feb 22 '23 10:02 hrishikesh-k