buxlabs / amd-to-es6

convert amd to es
MIT License
35 stars 17 forks source link

Comments retention support #112

Closed aapoalas closed 5 years ago

aapoalas commented 5 years ago

Hello,

While adding dynamic import support the comment retention support was removed. I presume this has to do with problematics to do with dynamic imports and comments, perhaps. In any case, it is a sad day to see the support go.

Are there any things that could be done to bring it back? In this code base or Acorn?

emilos commented 5 years ago

The parser we're using under the hood is cherow which dropped the support due to possible ambiguous comment placement.

I would try there first, otherwise you'd probably need to roll out your own solution that suits your use case. I haven't seen a perfect way to handle the comments yet (maybe by having a concrete syntax tree parser but that's a separate challenge on it's own).