lucene icon indicating copy to clipboard operation
lucene copied to clipboard

ES6 modules

Open nicolashenry opened this issue 5 years ago • 3 comments

Would you consider using ES6 modules?

Thanks :)

nicolashenry avatar Feb 14 '19 17:02 nicolashenry

Hey @nicolashenry,

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

bripkens avatar Feb 15 '19 10:02 bripkens

@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.

nicolashenry avatar Feb 15 '19 18:02 nicolashenry

@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 :).

bripkens avatar Feb 17 '19 17:02 bripkens