re-template-tag icon indicating copy to clipboard operation
re-template-tag copied to clipboard

compatibility with .mjs specification

Open lorenzofox3 opened this issue 5 years ago • 2 comments

The package can not be imported from a .mjs file: the "main" entry point refers to a cjs with other export than a default.

  1. main should not specify an extension.
  2. this "main" should have both version: a .mjs version with the ES6 module and a .js with the CJS version.

You can have a look this issue for more details

Thanks !

lorenzofox3 avatar Aug 07 '18 12:08 lorenzofox3

I’ll update this code once there is an actual standard. At the moment, everything is in flux.

rauschma avatar Aug 09 '18 15:08 rauschma

I understand your point. However there is no code to change, only the build script (I can do it if it 's too much of a trouble) and the package.json. Moreover that would be a quick win for various build tools whereas there should not be any drawback/non backward changes.

Otherwise what would you suggest me to do to workaround the faced issue ?

  • I could include your package in the bundle when I build my library. The downside is that I would have to rebuild and republish a version whenever you publish a new version (which somehow breaks the concept of dependency :) )
  • Anyway, your library is small enough and does not change a lot. I could simply copy/paste the code (with the same problems than above though)
  • drop the support of .mjs extension

lorenzofox3 avatar Aug 09 '18 18:08 lorenzofox3