Skip to content

Commit 0e38377

Browse files
committed
Fix Vite build issues for production deployment
1 parent 1494b6a commit 0e38377

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ COPY . .
77
# Install root dependencies
88
RUN npm install
99

10-
# Install and build client
11-
RUN cd client && npm install && npm run build
10+
# Install and build client (including dev dependencies)
11+
RUN cd client && npm install --production=false && npm run build
1212

1313
# Install server dependencies
1414
RUN cd server && npm install

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ set -e
55
# Install dependencies and build
66
npm install
77

8-
# Install client dependencies and build
8+
# Install client dependencies and build (including dev dependencies)
99
cd client
10-
npm install
10+
npm install --production=false
1111
npm run build
1212

1313
# Install server dependencies

client/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"dependencies": {
1313
"@heroicons/react": "^2.2.0",
1414
"@tailwindcss/forms": "^0.5.9",
15+
"@vitejs/plugin-react": "^4.3.4",
1516
"autoprefixer": "^10.4.20",
1617
"axios": "^1.7.9",
1718
"i18next": "^24.2.0",
@@ -20,18 +21,17 @@
2021
"react": "^18.3.1",
2122
"react-dom": "^18.3.1",
2223
"react-i18next": "^15.4.0",
23-
"vite": "^5.0.0"
24+
"vite": "^5.0.0",
25+
"tailwindcss": "^3.0.0"
2426
},
2527
"devDependencies": {
2628
"@eslint/js": "^9.17.0",
2729
"@types/react": "^18.3.18",
2830
"@types/react-dom": "^18.3.5",
29-
"@vitejs/plugin-react": "^4.3.4",
3031
"eslint": "^9.17.0",
3132
"eslint-plugin-react": "^7.37.2",
3233
"eslint-plugin-react-hooks": "^5.0.0",
3334
"eslint-plugin-react-refresh": "^0.4.16",
34-
"globals": "^15.14.0",
35-
"tailwindcss": "^3.0.0"
35+
"globals": "^15.14.0"
3636
}
3737
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"version": "1.0.0",
44
"description": "Secure file transfer application",
55
"scripts": {
6-
"install-client": "cd client && npm install",
6+
"install-client": "cd client && npm install --production=false",
77
"install-server": "cd server && npm install",
8-
"build-client": "cd client && npm install && npm run build",
8+
"build-client": "cd client && npm install --production=false && npm run build",
99
"start": "cd server && npm start",
1010
"build": "npm run install-server && npm run build-client"
1111
},

0 commit comments

Comments
 (0)