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

browser support #1

Open
davidchambers opened this issue Apr 14, 2017 · 5 comments
Open

browser support #1

davidchambers opened this issue Apr 14, 2017 · 5 comments

Comments

@davidchambers
Copy link

Based on sanctuary-js/sanctuary-site#23 it seems one can't simply import HMP via a <script> tag. I would very much like to be able to do so. I suggest either:

  • including a browser build in the tarball; or
  • having a single source file which uses the export mechanism appropriate to the environment.

I prefer the latter. It adds a bit of boilerplate, but obviates the need for a build step. :)

@kedashoe
Copy link
Owner

I think we need a build step as we are depending on nearley. There is already a build step though, which I added after reading fluture-js/Fluture#58, so no big deal there.

I guess we'd basically be doing what ramda is to create the version in dist? Inlining require and adding a little wrapper around it? I couldn't find an npm package that does this, do you know of one?

@davidchambers
Copy link
Author

I couldn't find an npm package that does this, do you know of one?

No. I haven't yet needed such a tool.

@kedashoe
Copy link
Owner

k I'll keep looking/figure something out.

@mickdekkers
Copy link

May I suggest using Rollup to create an IIFE or UMD build? Using that it should be possible to bundle the nearley dependency in your build. This should make it possible to directly use the build in a <script> tag.

@kedashoe
Copy link
Owner

Thanks @mickdekkers . Ended up not needing it for this issue as we bundled a parent lib for the browser, but I'll leave the issue open and look into using rollup for a browser build for this lib.

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