cjstoesm icon indicating copy to clipboard operation
cjstoesm copied to clipboard

Issue when trying to transform module.exports with object

Open samuelgja opened this issue 2 years ago • 0 comments

  • Version: 2.1.2
  • TypeScript Version: 4.8.4
  • Operating System and version (if applicable): mac
  • Node Version (if applicable): 14.18

Desc

First at all, thanks for thus transformer, it works in 99% scenarios.

But still there are some scenarios where it's not working. For example

module.exports = {
    'font-face': require('./font-face'),
};

will transform into the:

export const font-face = require('./font-face');
export default {
    font-face,
};

Check font-face transform - assigned to the new const value but in incorrect syntax: "font-face"

Expected behaviour

  • do not assign new const value and keep it somehow in export default statement?
  • or when creating new const value check if its in correct syntax.

samuelgja avatar Oct 18 '22 22:10 samuelgja