Closed LorisSigrist closed 6 months ago
This is a breaking change. Existing node16 imports ending with .js
won't work anymore.
I also do not like this change because it's node-specific. ECMAScript contains no spec about .mjs
. I could live with a config option mjsFileExtension
but strongly advocate against deviating from ECMAScript.
ECMAScript doesn't specify a file extension, since they are meaningless on the web anyway. Browsers only care about the mime-type. I'm also not aware of any build tool that doesn't support .mjs
extensions.
We do need something like this, otherwise it's impossible to use paraglide's output from a CJS environment. A config option could be a good way to go.
Currently, if you can't use Paraglide in a CJS project, since it will wrongly interpret paraglide's
.js
files as CJS. If we switch the extension to.mjs
it should always work.This may be a breaking change