node-pid-controller icon indicating copy to clipboard operation
node-pid-controller copied to clipboard

Build to ES5

Open nattelog opened this issue 9 years ago • 6 comments

The current npm package isn't built to ES5, only ES6. Is there a reason for it? Or is it possible to compile the code before publishing it?

nattelog avatar Aug 04 '16 07:08 nattelog

Hey Natanael,

Could you tell me more about the reason you need the ES5 version? In which environment are you using this package?

Philmod avatar Aug 04 '16 16:08 Philmod

Hi,

In my device model I use velocity model which use your PID controller. I use the device model on a website so the ES6 pid controller code runs there. It works on Chrome but not on Safari. I could build it myself but I thought it would be better if it was already built when I require it.

nattelog avatar Aug 05 '16 09:08 nattelog

If you use browserify, you should be able to compile it in the format you need. Would that help?

Philmod avatar Aug 05 '16 13:08 Philmod

Well, my project use webpack. Perhaps it has a solution for it. Thanks for the help anyway! :smile:

nattelog avatar Aug 09 '16 07:08 nattelog

You have to use a compiler like Babel, that will work with webpack.

Philmod avatar Aug 09 '16 14:08 Philmod

I've submitted a PR (#9) to accomplish this without duplicating files, either in the source or in the npm module. It's opinionated so you're 100% free to just disregard! For me though, I was just making a medium-sized browser-targeted demo that didn't really benefit at all from ES6, so it was just a bit unpleasant to babelify the whole project for one dependency (requires working browserify into the dev server and build step, which isn't that bad, but a slight pain). Either way though, thanks for the great module!

rreusser avatar Aug 18 '16 19:08 rreusser