hildjj / node-cbor

Encode and decode CBOR documents, with both easy mode, streaming mode, and SAX-style evented mode.
MIT License
358 stars 73 forks source link

Publish Pre-Compile to ES5 #60

Closed ghost closed 3 years ago

ghost commented 6 years ago

I was trying to npm run build in create-react-app and it failed to minify. create-react-app recommends compiling into ES5. Could you publish pre-compiled to npm?

klappy commented 6 years ago

I am running into this issue as well. If anybody is able to confirm a solution or workaround, please post.

Related to #57

igrek8 commented 6 years ago

Sadly, no further progress has been done :(

igrek8 commented 6 years ago

@klappy

After digging an hour into the issue I found a quick fix


npm i --prefix ./node_modules/autobahn/node_modules/cbor babel-preset-env babel-polyfill --save-dev
/usr/local/bin/babel --presets env --plugins transform-runtime ./node_modules/autobahn/node_modules/cbor/lib --out-dir ./node_modules/autobahn/node_modules/cbor/lib.es5
mv ./node_modules/autobahn/node_modules/cbor/lib ./node_modules/autobahn/node_modules/cbor/lib.es6
mv ./node_modules/autobahn/node_modules/cbor/lib.es5 ./node_modules/autobahn/node_modules/cbor/lib
npm run build 
hildjj commented 6 years ago

If someone sends me a PR that does the necessary things and doesn't impact the node build, i'll be happy to include it.

hildjj commented 3 years ago

cbor-web is now published at version 7.0.0, it's what you want.