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

Add "development" NODE_ENV option for build #819

Closed
bartbutenaers opened this issue May 1, 2024 · 4 comments
Closed

Add "development" NODE_ENV option for build #819

bartbutenaers opened this issue May 1, 2024 · 4 comments
Labels
feature-request New feature or request that needs to be turned into Epic/Story details size:S - 2 Sizing estimation point

Comments

@bartbutenaers
Copy link
Contributor

Hi guys,

In the vite.config.js file of the node-red-dashboard-2-ui-example repository there is a mechanism available to skip the minification of the code during development. Which I use in this way:

  1. Set the related environment variable during development:
    export NODE_ENV=development
    
  2. Create a bundle:
    npm run build
    
  3. Now I can debug the frontend code in the vue file easily because I see the original code.

However I don't see that variable in the dashboard. Instead I see in the package.json file another mechanism. So not sure if my above way of working is optimal...

Could anybody enlighten me a bit what is the best way to use this, and why the custom nodes need to use that environment variable. Or is there perhaps a relation between the build:dev and the NODE_ENV? Because I would like to see both the dashboard code and my own custom node code without minification...

Thanks!
Bart

@joepavitt
Copy link
Collaborator

Not necessarily an intentional play here. Think this was just overlooked when doing the build pipeline for Dashboard as vite was introduced after some time of already having a webpack build in place. For the UI Example, we built that using a template generator, so it would have come packaged with it.

Will update this to be requesting a "development" mode for working with Dashboard

@joepavitt joepavitt changed the title Best way to skip minification Add "development" NODE_ENV option for build May 1, 2024
@joepavitt joepavitt added size:S - 2 Sizing estimation point feature-request New feature or request that needs to be turned into Epic/Story details labels May 1, 2024
@bartbutenaers
Copy link
Contributor Author

Thanks!
But how can I avoid the dashboard to be minified?

@joepavitt
Copy link
Collaborator

But how can I avoid the dashboard to be minified?

Currently, not a configuration option

@bartbutenaers
Copy link
Contributor Author

Going to close this issue since the pull request is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request that needs to be turned into Epic/Story details size:S - 2 Sizing estimation point
Projects
None yet
Development

No branches or pull requests

2 participants