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

NODE_ENV explicitly specified #23402

Closed
3 of 4 tasks
or2e opened this issue Sep 25, 2023 · 3 comments
Closed
3 of 4 tasks

NODE_ENV explicitly specified #23402

or2e opened this issue Sep 25, 2023 · 3 comments

Comments

@or2e
Copy link

or2e commented Sep 25, 2023

Describe the feature

I have experienced that when running a build project using node ./.output/server/index.mjs vue.js was running in dev mode, because if you don't define NODE_ENV=production node ./.output/server/index.mjs, then you will get a dev build of vue.js (by default) https://github.com/vuejs/core/blob/main/packages/runtime-core/index.js

Do you think it is necessary to add this note to the doc? (https://nuxt.com/docs/getting-started/deployment#nodejs-server)

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

cc: @pi0 It seems we have a regression with tracing export conditions as the Vue dev build is also getting picked.

reproduction from linked issue: https://stackblitz.com/edit/nuxt-examples-tnmdbb?file=package.json.

@pi0
Copy link
Member

pi0 commented Jan 2, 2024

Checking reproduction, it seems that @vue/runtime-core/package.json is not using any export conditions (was it before?) that nitro externals tracer could rewrite for. Since @vue/runtime-core/index.js uses two require for two builds, nitro also (correctly) traces two builds so I don't think it is a bug but something definitely worth to fix.

On vue side, we had been tracing it for a long time for supporting exports field in their package.json @danielroe do you remember why latestly it wasn't introduced?

For a solution in Nitro we can:

@danielroe
Copy link
Member

This is now resolved (for vue) in the latest release of @vue/runtime-core! 🎉

See bundle size diff in https://github.com/nuxt/nuxt/pull/25036/files#diff-04a7585c5d6ddd5cf80321c69bc6e07cd85e9e86ae35fa5f9c036651f137c312.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants