jwagner / simplex-noise.js

A fast simplex noise implementation in Javascript / Typescript.
MIT License
1.61k stars 130 forks source link

experimental es module support #27

Closed chase-moskal closed 3 years ago

chase-moskal commented 5 years ago

hello friend,

i wanted to load simplex-noise as a hip new web-ready es module

i created this branch and also published simplex-noise-esm@2.5.0-esm.0 to npm for my own usage

the es module is available now via cdn here: https://unpkg.com/simplex-noise-esm@2.5.0-esm.0/dist-esm/simplex-noise.js

i used babel-plugin-transform-commonjs to generate the es module distribution

codepen example demonstrates loading simplex-noise-esm as an es module

chase-moskal commented 5 years ago

hello

i see the build failed under node 4

node 4 has been deprecated for a long time now, so we should simply drop it from the travis config

plus the consumable package will still work in node 4, it's only the babel-related build tooling that is presenting an issue

amilajack commented 5 years ago

I think its actually that the version of eslint doesn't support node 4. I agree that we should drop node 4. We should probably use travis node versions:

node_js:
  - node
  - 8
jwagner commented 3 years ago

I somehow missed this PR when it was created but I'm now working on getting esm support in. I'll probably also port it to typescript and restructure it to enable tree shaking while at it. Same setup as I used for https://github.com/jwagner/dont-crop/.

Sorry for the really slow reply @chase-moskal

jwagner commented 3 years ago

Since the typescript port has landed and supports esm natively I'm closing this MR.

Thanks a lot for the initial work @chase-moskal . Much appreciated!