`env.mjs` as opposed to `env.cjs` or `env.js`
Heya, is there a reason why the env definition is in an
mjs
file as opposed to cjs
or simply js
? Reason I'm asking is because I'm trying to setup websockets and mjs
won't work as we're compiling with commonjs
.6 Replies
you should be able able to put them in .ts too
I think the reason
ts
doesn't work is because of this line in next.config.mjs
I'm assuming this is the old env setup. But iirc the env is imported in the next.config.mjs and you cant import ts into that (or commonjs iirc)
Either that or mjs is used because modules are just better :3
yeah our t3
init
version is 7.5.1
let me see if anything breaks if I just convert env.mjs
to env.js
in all the places
ok yeah then next gets mad
you have to change the imports to require if you do commonjs
import is only for modules
yah indeed testing that now