Hello I am struggling to use the javascript-lp-solver.
I have added the package to a collection using the NPM plugin.
However, when I try to reference it, it shows as empty.
Looking in the console, it seems to be importing the script, but the script ‘requires’ another script, which I think it cannot find. See the screenshot below, error on line 20, reading:
“Uncaught ReferenceError: require is not defined”
I’ve read online the browsers need an ‘import’ statement here instead?
Finally, in the documentation, there seems to be a way to do it via Node, Web and Webpack ( does weweb use webpack?) See documentation snippet below:
### Install:
(in Node)
npm install javascript-lp-solver --save
(in browser through CDN)
html
<script src="https://unpkg.com/javascript-lp-solver/prod/solver.js"></script>
(webpack)
javascript
const webpack = require('webpack'); //to access built-in plugins
module.exports = {
"mode": "development",
"plugins": [
new webpack.IgnorePlugin(/(fs|child_process)/),
]
}
Im a bit lost on how to get this working and would love some help!
Thanks