Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to compile the built results into .js instead of .mjs ? #14659

Closed
3 of 4 tasks
sunnywanggit opened this issue Aug 20, 2022 · 5 comments
Closed
3 of 4 tasks

How to compile the built results into .js instead of .mjs ? #14659

sunnywanggit opened this issue Aug 20, 2022 · 5 comments

Comments

@sunnywanggit
Copy link

Describe the feature

How to compile the built results into .js instead of .mjs ?

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

@danielroe
Copy link
Member

This is already implemented by default on the edge channel: https://v3.nuxtjs.org/guide/going-further/edge-channel/

See nuxt/framework#6505

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Aug 20, 2022
@sunnywanggit
Copy link
Author

The server code still ends with .mjs
image

@pi0
Copy link
Member

pi0 commented Sep 2, 2022

@sunnywanggit Those assets are not served to the browser. Nitro output is ESM by default with .mjs ext because it requires ESM features. Why you would need .js extension for them?

@sunnywanggit
Copy link
Author

@pi0 Mainly for compatibility, Lower versions of node do not support mjs

@danielroe
Copy link
Member

Nuxt 3 requires the latest LTS node version.

@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants