Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publishing an es module version #18

Open
daKmoR opened this issue Feb 17, 2021 · 2 comments
Open

publishing an es module version #18

daKmoR opened this issue Feb 17, 2021 · 2 comments

Comments

@daKmoR
Copy link

daKmoR commented Feb 17, 2021

interested in publishing an es module version?

e.g. so you could do something like this directly in the browser

import { flate, init } from 'wasm-flate';

await init();
flate.gzip_encode(...)

if yes then I could look into preparing a pull request 🤗

@bluthen
Copy link

bluthen commented Mar 2, 2021

Even if it is your own fork, I and I'm sure others would be interested. I'm having to do the same work right now also.

This is what I did, to use ES6 import with webpack.

  • Installed rust, wasm-pack
  • git clone wasm-flate; cd wasm-flate
  • wasm-pack build -- --features "browser strings"
  • Modified pkg/package.json to include wasm_flate_bg.js in "files"
  • cd pkg, npm pack
  • cd myproject; npm install [the tar.gz from npm pack]
  • In my code: import('wasm-flate').then((flate)=>{ //can use flat now, like: flate.gzip_encode(mystring) // });

@Junior2Ran
Copy link

yes, plz publish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants