martpie / next-transpile-modules

Next.js plugin to transpile code from node_modules. Please see: https://github.com/martpie/next-transpile-modules/issues/291
MIT License
1.13k stars 85 forks source link

Attempt to have ntm:source field support #205

Closed belgattitude closed 3 years ago

belgattitude commented 3 years ago

Source field convention try-out and console.logs... Probably just bad ideas

Idea

In current NTM version, the main field package is used to locate the (shared) package sources.

This makes it harder to publish packages on npm, cause the field should be used to locate the 'build' files (dist folder).

An idea was to use the source field, which is a convention used by microbundle... But I think this is dangerous cause we can have unexpected scenarios with regular packages (living in node_modules).

Another idea is to have a specific field ntm:source to indicate the path of the transpilable source.

That's what I'm trying to figure out, but not sure I'll do.