Skip to content

Commit

Permalink
Reduce node_modules folder size
Browse files Browse the repository at this point in the history
  • Loading branch information
maggie44 committed Jan 19, 2023
1 parent 160ca40 commit 140bf8b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY expressjs/package.json expressjs/package.json
COPY ui/package.json ui/package.json

# Install packages
RUN yarn install --immutable --network-timeout 600000
RUN yarn install --frozen-lockfile --network-timeout 600000

# Copy source files to container
COPY expressjs expressjs
Expand All @@ -28,8 +28,10 @@ RUN yarn build
RUN ON_DEVICE=false yarn build-pwa

# UI build is done, so we now reduce the node_modules folder down
# to the essentials required for ExpressJS
RUN yarn install --immutable --production --network-timeout 600000
# to the essentials required for ExpressJS.
# Requires moving package.json due to a yarn bug: https://github.com/yarnpkg/yarn/issues/6715
RUN mv expressjs/package.json ./
RUN yarn install --frozen-lockfile --production --network-timeout 600000


## Primary container
Expand Down
2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"workbox-strategies": "^6.5.4"
},
"engines": {
"node": "^18 || ^16",
"node": "^18",
"npm": ">= 6.13.4",
"yarn": ">= 1.21.1"
}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/api/supervisor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const v2 = {
type: 'GET',
path: 'v2/device/name',
params: false,
cacheTimeout: 60
cacheTimeout: 6000
})
},
device_tags() {
Expand Down

0 comments on commit 140bf8b

Please sign in to comment.