Skip to content

using in npm #2

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

Closed
okdistribute opened this issue Sep 10, 2016 · 8 comments
Closed

using in npm #2

okdistribute opened this issue Sep 10, 2016 · 8 comments

Comments

@okdistribute
Copy link

okdistribute commented Sep 10, 2016

When one uses require(web-streams-polyfill) it isn't installing the spec directory and that content isn't included in the minified version, so you get errors like

app.js:1 Error: Cannot find module './spec/reference-implementation/lib/writable-stream'

Could you fix the build process so the package is requirable on npm? thank you!

@derhuerst
Copy link

derhuerst commented Sep 10, 2016

Adding "spec" to the files field in package.json would solve the issue.

@derhuerst
Copy link

I just noticed that the following works for me:

npm install web-streams-polyfill
node -e 'require("web-streams-polyfill")'

@jimmywarting
Copy link

Think #1 can solve this

@jimmywarting
Copy link

I'm. Just spekulating but maybe this will work in the meanwhile...?

require("web-stream-pollyfil/dist/polyfill.min.js")

@creatorrr
Copy link
Owner

Hmm, I don't understand why this is happening. The package.json declares the main and browser scripts properly. Will investigate further.

@neovov
Copy link

neovov commented Nov 3, 2016

I tried using this polyfill in a browserify workflow and stumble upon this issue.
It seems that browserify cannot use an already browserified file. I tried by changing the bundle task, adding a derequire and it seems to work.

Sorry, I don't have time to send you a pull request right now, but you can change this, in the package.json file:

"bundle": "browserify index.es6.js -s default -o dist/polyfill.js -t [ babelify ]",

With:

"bundle": "browserify index.es6.js -s default -t [ babelify ] | derequire > dist/polyfill.js",

(and add the derequire as devDependencies)

@creatorrr
Copy link
Owner

Done @neovov

@okdistribute
Copy link
Author

thank you!

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

5 participants