Esm: Seems to not work for me?

Created on 11 Aug 2017  路  3Comments  路  Source: standard-things/esm

Am i idiot and i'm not getting something or what? :D

I have few (6-7 files) full esm, some of them import others of them and all of them export default. I have "esm": "js" option on, because don't want to rename them. Then i have one test.js file from which i am trying to get the result of index.js which export default a function.

require('@std/esm')

console.log(require('./index.js')) // => { [Symbol(@std/esm:sourceType)]: 'module' }
console.log(require('./index.js').default) // => undefined

How to get the function that is exported by index.js?

2017-08-11-13 56 26_1280x1024_scrot
2017-08-11-13 56 23_1280x1024_scrot

duplicate

Most helpful comment

Hi @charlike!

It's not your fault. I believe this is related to (likely a dup of) #15.
I'm finishing up the patch so it should be fixed today :)

All 3 comments

Hi @charlike!

It's not your fault. I believe this is related to (likely a dup of) #15.
I'm finishing up the patch so it should be fixed today :)

hm, strange, didn't get the notification.

Cool! I'll try it.

Fixed with v0.3.0 馃帀

Was this page helpful?
0 / 5 - 0 ratings