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

Running in Browser #80

Closed
kel89 opened this issue Nov 8, 2018 · 2 comments
Closed

Running in Browser #80

kel89 opened this issue Nov 8, 2018 · 2 comments

Comments

@kel89
Copy link

kel89 commented Nov 8, 2018

Hello,

This is probably a rather basic issue, but I am new to javascript. I am wondering if there is a way to make this library work with javascript running solely in a browser? I am running into issues with the many "require()" statements. I have tried bundling everything into a single file using Browserify, but still no luck.

Any help would be greatly appreciated!

@redblobgames
Copy link

If you don't want to use Browserify, Webpack, etc., you can use Unpkg to turn it into a simple script that you can load:

<script src="https://unpkg.com/javascript-lp-solver/src/solver.js"></script>

This will create a global variable solver. You'll be able to call solver.Solve(…) with your model. (I've only tested this with the first example on the readme)

@JWally
Copy link
Owner

JWally commented Oct 3, 2019

So for what its worth, there's a browser ready version under /prod/solver.js. Its not minified or gziped or anything, but, its out there if you want to host the file yourself.

@JWally JWally closed this as completed Oct 3, 2019
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