Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properties will be discarded after object.assign #813

Open
pi0 opened this issue Jun 4, 2019 · 0 comments
Open

properties will be discarded after object.assign #813

pi0 opened this issue Jun 4, 2019 · 0 comments

Comments

@pi0
Copy link

pi0 commented Jun 4, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant