Updates for using vite in the dev containers (#1413)

This commit is contained in:
jbirddog 2024-04-17 14:04:07 -04:00 committed by GitHub
parent a44ddd0ff8
commit 8ad9e9c8fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 4 deletions

View File

@ -21,6 +21,7 @@ IN_FRONTEND ?= $(DOCKER_COMPOSE) run $(FRONTEND_CONTAINER)
SPIFFWORKFLOW_BACKEND_ENV ?= local_development
BACKEND_SQLITE_FILE ?= src/instance/db_$(SPIFFWORKFLOW_BACKEND_ENV).sqlite3
NODE_MODULES_DIR ?= spiffworkflow-frontend/node_modules
JUST ?=
YML_FILES := -f docker-compose.yml \
@ -94,6 +95,11 @@ fe-logs:
fe-npm-i:
$(IN_FRONTEND) npm i && git checkout -- spiffworkflow-frontend/package-lock.json
fe-npm-rm:
@if [ -d "$(NODE_MODULES_DIR)" ]; then \
rm -rf "$(NODE_MODULES_DIR)"; \
fi
fe-sh:
$(IN_FRONTEND) /bin/bash
@ -127,6 +133,6 @@ take-ownership:
start-dev stop-dev \
be-clear-log-file be-logs be-mypy be-poetry-i be-poetry-lock be-poetry-rm \
be-db-clean be-db-migrate be-sh be-sqlite be-tests be-tests-par \
fe-lint-fix fe-logs fe-npm-i fe-sh fe-unimported \
fe-lint-fix fe-logs fe-npm-i fe-npm-rm fe-sh fe-unimported \
poetry-i poetry-rm pre-commit ruff run-pyl \
take-ownership

View File

@ -2,4 +2,4 @@ FROM node:20.8.1-bookworm-slim AS base
WORKDIR /app
CMD ["npm", "run", "docker:start"]
CMD ["npm", "run", "start"]

View File

@ -6,6 +6,9 @@ import { defineConfig } from 'vite';
import viteTsconfigPaths from 'vite-tsconfig-paths';
let host = process.env.HOST ?? 'localhost';
let port = process.env.PORT ? parseInt(process.env.PORT) : 7001;
export default defineConfig({
// depending on your application, base can also be "/"
base: '/',
@ -25,10 +28,12 @@ export default defineConfig({
server: {
// this ensures that the browser DOES NOT open upon server start
open: false,
port: 7001,
host,
port,
},
preview: {
port: 7001,
host,
port,
},
resolve: {
alias: {