swellstores / swell-js

JS library for building storefronts and checkouts with Swell ecommerce.
https://swell.is
MIT License
139 stars 29 forks source link

fix: add exports field to package.json and use cjs/mjs filename + ignore dist #125

Closed stafyniaksacha closed 1 year ago

stafyniaksacha commented 1 year ago

This PR improves rollup build in order to use .cjs and .mjs. This allows to load those in different environments.

It adds exports fields to package.json to improve usage with bundlers (typescript, vite, ...).

I removed the dist folder from the repo (it should not be needed), and added prepack script, so the dist folder is automatically generated when running npm publish.

Here are some useful reports about current state: https://publint.dev/swell-js@3.22.4