Closed JWally closed 9 years ago
@bchevalier here's what I'm thinking of doing to fix the issue of needing 2 files to work in 2 environments; question is would it mess you up too much?
src/solver.js
to src/main.js
grunt prod
will produce a browserfied version of the project at src/solver.js
. This way, the entry point to the project is always at src/solver.js
. This keeps the project from breaking anything that uses it as a dependencysrc/solver.js
file, I'll append a piece of code that looks something like this: (function(){
// Only execute if we're in node
if(typeof module === "object"){
// Have this file act as a facade
// for src/main.js, which houses the
// guts of this project
module.exports = require("./main");
}
})()
'4. Some time in the future remove the prod
directory
Currently, the browserfied version of solver.js returns a blank object in the node environment. I think this'll fix that issue.
This is solution is fine by me, and if you think that will do it then go for it.
By the way, could you make a new npm release?
Done
On Mon, Oct 19, 2015 at 5:01 AM, Brice notifications@github.com wrote:
By the way, could you make a new npm release?
— Reply to this email directly or view it on GitHub https://github.com/JWally/jsLPSolver/issues/14#issuecomment-149172300.
thanks!
Would like to have 1 file work in the browser environment (raw and asm) and in Node as well. Currently have 2 versions in existence (1 at prod/solver.js and the other at src/solver.js)