bripkens / lucene

Node.js lib to transform: lucene query → syntax tree → lucene query
MIT License
72 stars 33 forks source link

ES6 modules #22

Open nicolashenry opened 5 years ago

nicolashenry commented 5 years ago

Would you consider using ES6 modules?

Thanks :)

bripkens commented 5 years ago

Hey @nicolashenry,

what would be the benefit for this project/for the users?

nicolashenry commented 5 years ago

@bripkens The benefit would be to be able to load this library without the need of a bundler when used in the browser and in my case to take advantage from treeshaking with rollupjs.

The idea would be for example to provide an additional version of the library in the final package with the "module" property referencing it. Rollup and Webpack both understand this property, see here. You could translate the ES6 module version to commonjs with a transpiler like this one to prevent code duplication.

bripkens commented 5 years ago

@nicolashenry: Sounds like a fine idea. Though I have no capacity/need for this. If you need it, feel free to open up a PR :).