You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently production node_moudules have dev dependency present in it . So which is not required in production. This dev dependency is only required during development of application not in production.
Describe the solution you'd like
-If we want to to reproduce this issue . Then first build the application using 'npm run build' . Then run this command npm prune --production . If we start the server using this command 'npm run prod'. Then you can see some packages that are listed under development dependency is still used in production so you will see an error the modules is not found.
-So my approch is to to compare the dependecy used in production and development enviroment then which packages are used in both production but listed under development in package.json are removed under it and add into dependecy as production.
-As a result of this only devlopment dependcy will remove by prune command . And production packages are remain unaffected.
-It will optimize our packages for production enviroment by removing unwanted nodemodules.
-Around 200-300MB of node_modules size wiil decrease which is a significant size. Which is further be helpful for our docker production image built.
Describe alternatives you've considered
write two script first one is for comparision between development and prodution dependcy and genrate the output in json format.
Save the output of this script which will furhter be used .
By using diff command compare both the json files and list the common depnedcy that are used in production and development .
-Then check if the common packages are listed under development dependecy or not . If it under the dev then it should be in production dependency list.
-Then successfully executing both the script use the command npm prune --production . Then start the server by using npm run prod. If the server start with out error like nodemodules is not found . Then it solves our problem.
Approach to be followed (optional)
N/A
Additional context
Potential internship candidates
Please read this if you are planning to apply for a Palisadoes Foundation internship
@palisadoes plz check this one.This is one followup for the optimization for our docker image in prodution enviroment .plz assign . I have this script and working. This is a new feature that's why i opened this issue. If u want to implement this feature in my existing pr then i will make changes docker efficiency pr.
Is your feature request related to a problem? Please describe.
Currently production node_moudules have dev dependency present in it . So which is not required in production. This dev dependency is only required during development of application not in production.
Describe the solution you'd like
-If we want to to reproduce this issue . Then first build the application using 'npm run build' . Then run this command npm prune --production . If we start the server using this command 'npm run prod'. Then you can see some packages that are listed under development dependency is still used in production so you will see an error the modules is not found.
-So my approch is to to compare the dependecy used in production and development enviroment then which packages are used in both production but listed under development in package.json are removed under it and add into dependecy as production.
-As a result of this only devlopment dependcy will remove by prune command . And production packages are remain unaffected.
-It will optimize our packages for production enviroment by removing unwanted nodemodules.
-Around 200-300MB of node_modules size wiil decrease which is a significant size. Which is further be helpful for our docker production image built.
Describe alternatives you've considered
-Then check if the common packages are listed under development dependecy or not . If it under the dev then it should be in production dependency list.
-Then successfully executing both the script use the command
npm prune --production
. Then start the server by usingnpm run prod
. If the server start with out error like nodemodules is not found . Then it solves our problem.Approach to be followed (optional)
N/A
Additional context
Potential internship candidates
Please read this if you are planning to apply for a Palisadoes Foundation internship
The text was updated successfully, but these errors were encountered: