Change dev/prod ones

This commit is contained in:
Matt DiMeglio 2025-06-11 16:49:54 -04:00
parent fafce681ed
commit 7153472ddf
4 changed files with 55 additions and 21 deletions

View file

@ -1,11 +1,11 @@
{
"name": "shiftsync-website",
"private": true,
"version": "1.0.1",
"version": "0.0.0",
"main": "index.js",
"scripts": {
"api": "npm run dev --prefix api",
"web": "npm run dev --prefix web",
"web": "npm run local --prefix web",
"dev": "concurrently \"npm run api\" \"npm run web\"",
"test": "echo \"Error: no test specified\" && exit 1"
},

15
web/Dockerfile.prod Normal file
View file

@ -0,0 +1,15 @@
FROM node:20-alpine
WORKDIR /app
COPY ./package*.json ./
RUN npm ci
COPY . ./
EXPOSE 5173
EXPOSE 5171
CMD ["npm", "run", "prod"]

View file

@ -1,10 +1,12 @@
{
"name": "shiftsync-website-web",
"private": true,
"version": "1.0.0",
"version": "1.0.1",
"type": "module",
"scripts": {
"dev": "vite --host",
"local": "vite",
"dev": "vite --host --mode dev",
"prod": "vite --host --mode prod",
"build": "vite build",
"lint": "eslint .",
"preview": "vite preview"

View file

@ -3,22 +3,39 @@ import react from '@vitejs/plugin-react';
import path from 'path';
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
server:{
host: true,
allowedHosts: ['.code-catalyst.com'],
cors: true,
hmr: {
protocol: 'wss',
host: ['*.code-catalyst.com'],
clientPort: 443,
}
},
resolve: {
alias: {
'@src': path.resolve(__dirname, 'src'),
'@components': path.resolve(__dirname, 'components')
export default defineConfig(({ mode = 'local' }) => {
const isDev = mode === 'dev';
const isProd = mode === 'prod';
return {
plugins: [react()],
server:{
host: true,
allowedHosts: ['.code-catalyst.com'],
cors: true,
hmr: isDev
? {
protocol: 'wss',
host: 'shift-dev.code-catalyst.com',
clientPort: 443,
}
: isProd ?
{
protocol: 'wss',
host: 'shift.code-catalyst.com',
clientPort: 443,
}
: {
protocol: 'wss',
host: 'localhost',
clientPort: 443,
},
},
},
resolve: {
alias: {
'@src': path.resolve(__dirname, 'src'),
'@components': path.resolve(__dirname, 'components')
},
},
}
});