This repository has been archived by the owner on May 3, 2024. It is now read-only.
fix(image): exclude devDeps from non-dev image #1085
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
move devDeps if-env, node-fetch, and proxy-agent from deps list
Motivation and Context
proxy-agent was found in the non-dev image when it shouldn't be there, so a search through the dependencies was started
all
NODE_ENV==='development'
was set tofalse
and subsequent code simplification performedusing the dependencies list, using
$ grep -rl $dependency src
showed that there were a few not used:Of these, some were found to be used by the bundler as dependencies that the one-app runtime provides to modules (webpack/webpack.common.js, webpack/app/webpack.client.js). This left if-env, node-fetch, and proxy-agent; the latter two are used by the development CDN. if-env is used in a package.json script which is similarly only used during development (note that the Dockerfile does not use package.json scripts, e.g.
$ npm start
as the CMD or ENTRYPOINT, so as to avoid unnecessary additional process(es))How Has This Been Tested?
commit hook, awaiting PR checks
Types of Changes
Checklist:
What is the Impact to Developers Using One App?
smaller images are faster to transfer and easier to store (use less bits on disk)