Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

Add support for Webpack's NodeJS targets #84

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ryan-codingintrigue
Copy link

I know the README says Not for use in Webpack, but Webpack isn't only used for outputting browser code. When using a target other than web (NodeJS, Electron, etc.) there's no reason this library shouldn't be able to be bundled using Webpack too.

The reason it doesn't work is because of this block of code:

desiredType = require(registeredAlgorithms[algName])

Webpack doesn't handle dynamic require very well.

This PR addresses the issue by turning the registeredAlgorithms into a factory function, rather than a path, allowing Webpack to effectively track which files should be bundled. This will allow users to use Webpack for any NodeJS target

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

Successfully merging this pull request may close these issues.

1 participant