Esm: Unable to `module.exports = esModule` without cloning

Created on 22 Sep 2017  路  2Comments  路  Source: standard-things/esm

https://github.com/arackaf/mongo-graphql-starter/blob/special/jdd/index.js#L3

Named exports, in particular createGraphqlSchema from

https://github.com/arackaf/mongo-graphql-starter/blob/special/jdd/src/module.js

are not available unless I clone the object, like in the original link above.

To repro, clone that repo, npm i then jump into the test folder and run node testRoot. With the Object.assign from the top-level index.js (or object spread, obviously), it works, and logs "function". If you remove the clone, and just export the ES module itself

module.exports = require("./src/module.js");

it blows up.

bug

All 2 comments

Thanks @arackaf!

This is an interesting case of cjs bridge use. I'll add a unit and cut a release soon.

v0.11.0 is released :tada:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

greggb picture greggb  路  3Comments

bensampaio picture bensampaio  路  3Comments

Mensu picture Mensu  路  3Comments

janusqa picture janusqa  路  3Comments

OmgImAlexis picture OmgImAlexis  路  3Comments