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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ws and dgram externals for browser environments #63

Merged
merged 5 commits into from
Apr 14, 2022

Conversation

adzialocha
Copy link
Owner

@adzialocha adzialocha commented Apr 14, 2022

This PR solves broken builds for Webpack users who get a warning about dependencies which are not available in browser contexts like dgram. This PR ..

  • Introduces a browser field in package.json which points at the special browser build osc.min.js
  • Replaces dgram and ws with custom files during browser builds to have better control than just checking global contexts

It works for me with Webpack / simple static html websites and in Node 馃憤

Closes: #50

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

Successfully merging this pull request may close these issues.

ModuleNotFoundError: Module not found: Error: Can't resolve 'dgram' in [...]
1 participant