Hi all,
JSPM does recognize it is an ES6 module
{
"main": "gaf.js",
"format": "cjs",
"meta": {
"*.json": {
"format": "json"
},
"gaf.js": {
"format": "esm"
}
}
but when imported I get this on Chrome
undefined:1 Uncaught (in promise) Error: (SystemJS) Unexpected token import(…)
and this in FF:
Error: (SystemJS) import declarations may only appear at top level of a module
The file in question does start with a top-level import.
Adding an explicit package rule in the jsm.config.js did bring me a bit further:
packages: {
"npm:g...@1.0.9": {
"format":"esm",
"map": {
"gl-context": "npm:gl-co...@0.1.1"
}
},
At this stage I get this in FF
8 | };
9 |
> 10 | setup = () => {
| ^
11 |
12 | };
13 |
and the same in Chrome
It seems to me that the transpiler did only transpile the index.js file in the module, but not the files imported from the index.
To reproduce locally, install "npm:gaf" and try to import the "gaf" module.
Any pointers on how to resolve that?
Thanks,
-- Sébastien