shershen08 / vue-masonry

💠 Vue.js directive for masonry blocks layouting ✅
MIT License
677 stars 81 forks source link

Distribute CJS version? #51

Closed mAAdhaTTah closed 6 years ago

mAAdhaTTah commented 6 years ago

Browserify is choking on this because it can't yet handle ESM. The src appears to be mostly ES5 code except for the import statements; pointing it at the dist grabs the version that comes with Vue bundled, so unfortunately, neither of versions currently available on npm can be consumed by browserify. Could you distribute a CJS version as well?

shershen08 commented 6 years ago

Good point @mAAdhaTTah I'll look into that asap

shershen08 commented 6 years ago

hey @mAAdhaTTah do you have an idea/example how that may be set up in the package.json file so that two versions of library are delivered ?

mAAdhaTTah commented 6 years ago

Offhand, this might be a useful example, from the framework I'm working on: https://github.com/valtech-nyc/brookjs/tree/master/packages/brookjs It's in a monorepo overall, but that should give you an idea of how I distribute cjs, esm, as well as a browser-friendly dist (although that last one I'm less sure is ideal).

shershen08 commented 6 years ago

hey @mAAdhaTTah CJS should be available ion a current version as well with following syntax var VueMasonryPlugin = require('vue-masonry').VueMasonryPlugin let me know if that helped