I am trying to repeat an example from Mozilla Hacks ( Export Lists ):
export {detectCats, Kittydar};
function detectCats() {}
class Kittydar {}
import {detectCats, Kittydar} from "./export.js";
console.log(detectCats);
console.log(Kittydar);
Unfortunately, Kittydar is undefined (by the way, the problem is the same with simple Object).
But if I put it exportafter the declaration Kittydar, this is normal:
class Kittydar {}
export {Kittydar};
import {Kittydar} from "./export.js";
console.log(Kittydar);
Is this a typo in the article?
I will pass this with the help babeland bundles with browserify. Then I include the output package in a regular .htmlfile (with tag <script>).
source
share