Open pi0 opened 5 years ago
3.2.25
3.2.20
probably related to #773, #776 where users try to mix CJS with ESM syntax.
options.js
import fs from 'fs' module.exports = {}
main.js
const esm = require('esm')(module) const options = esm('./options.js') options.dev = true console.log(options.dev) // true const b = Object.assign({}, options) console.log(b.dev) // undefined
Side note: This bug only happens when options.js is in mixed mode. not happening when it is pure ESM or pure CJS.
3.2.25
(works fine with <=3.2.20
)probably related to #773, #776 where users try to mix CJS with ESM syntax.
options.js
main.js
Side note: This bug only happens when
options.js
is in mixed mode. not happening when it is pure ESM or pure CJS.