Sinova/Collisions

How to use without ES6 import?

Opened this issue · 6 comments

How to use without ES6 import?

https://github.com/Sinova/Collisions#installation

Bundling solutions such as Webpack or Rollup.js make native modules compatible with all environments.

I recommend rollup

It would be nice tho to have that "dist" folder with builded files

Prozi commented

you can use like std/asm library i think

also babel

or just this fork https://www.npmjs.com/package/detect-collisions or sth similar

lexar commented

Would someone be so kind and post step-by-step instructions how to compile and run this project, preferably with Visual Studio Code?
My knowledge of javascript is vanilla and best described with this post.
Unfortunately, the tutorial on that website seems to be outdated too and does not cover ES6 modules. I also googled a lot on ES6 modules in general, rollup, Webpack and npm, but could not get this to work.
I would love to structure my code with modules, this project appears to be perfect to learn something about the new ways of javascript. But it's really difficult for me to find clear, contemporary instructions how to start.
Here is one of many failed attempts:
npm -i
npm install collisions
npm install --global rollup
rollup index.js --file bundle.js --format "iife"
npm run build

It seems obvious to everybody except me how to do this - this is my explanation why it's so difficult to find a decent tutorial. So I would appreciate any help.

Prozi commented

@lexar read more about bundling javascript with https://webpack.js.org/

and if you want more vanilla commonjs exports do npm install detect-collisions --save-dev maybe that will help

Prozi commented

also paste full output logs of above commands plz