stockfish.js icon indicating copy to clipboard operation
stockfish.js copied to clipboard

how to export stockfish object for any RequireJS compatible environment

Open x4niko opened this issue 5 years ago • 4 comments

how to export stockfish object for any RequireJS compatible environment

x4niko avatar Apr 14 '19 13:04 x4niko

I don't know enough about RequireJS to know if it's possible.

If you're using WASM, make sure to include all of the necessary files: stockfish.js and stockfish.wasm in the same directory.

If you just want to use plain JS, then all you need is stockfish.asm.js.

nmrugg avatar Apr 15 '19 00:04 nmrugg

when i use stockfish.js in Cocos Creator like:

var Stockfish = require('./stockfish.js');

i got exception: Stockfish is not a function

x4niko avatar Apr 15 '19 02:04 x4niko

Does require('./stockfish.asm.js') do anything different?

nmrugg avatar Apr 15 '19 02:04 nmrugg

Does require('./stockfish.asm.js') do anything different?

the same exception : Stockfish is not a function

x4niko avatar Apr 15 '19 04:04 x4niko