grame-cncm / guidolib

Guido project - music score layout engine - music description language

Home Page:http://guido.grame.fr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Javascript build is missing a ES6 output option.

jonhallur opened this issue · comments

To be compatible with modern web framework.

There is a new 'es6' target in the lang/javascript Makefile (dev branch). Not tested. I'm just wondering if the wasm file is affected and how it's compatible with both targets (js, mjs).

From the Emscripten docs.

EXPORT_ES6
Export using an ES6 Module export rather than a UMD export. MODULARIZE must be enabled for ES6 exports and is implicitly enabled if not already set.
This is implicitly enabled if the output suffix is set to ‘mjs’.

I just changed the Makefile on line 65 to include EXPORT_ES6=1 so I could use it. AFAIK the only change in the JS is that it is wrapped in a promise function, where you can give the module some setting and has an export default for the file.

Thanks for the info. Actually I used the implicit method i.e. the mjs suffix