From f4b3061dea62bd88a10d8253ed7280f475f96fc9 Mon Sep 17 00:00:00 2001 From: Nicholas Charriere Date: Sun, 19 Jan 2025 14:32:05 -0800 Subject: [PATCH] Fix build: Make tailwind config esm compatible, run prettier. (#477) * Make tailwind config esm compatible * Run pnpm run format --- .changeset/dirty-hotels-press.md | 2 +- docker-compose.yml | 4 ++-- packages/web/tailwind.config.js | 13 +++++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.changeset/dirty-hotels-press.md b/.changeset/dirty-hotels-press.md index c6ac1cf6..ed606f58 100644 --- a/.changeset/dirty-hotels-press.md +++ b/.changeset/dirty-hotels-press.md @@ -9,4 +9,4 @@ Added configurable network exposure for Docker deployments with secure defaults. - Optional network exposure via HOST_BIND environment variable - Configured port 2150 mapping for Docker container -Users can optionally expose their Srcbook instance to other network devices by setting HOST_BIND=0.0.0.0 when running Docker. \ No newline at end of file +Users can optionally expose their Srcbook instance to other network devices by setting HOST_BIND=0.0.0.0 when running Docker. diff --git a/docker-compose.yml b/docker-compose.yml index 94ae2e74..62d08991 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: context: . dockerfile: Dockerfile ports: - - "${HOST_BIND:-127.0.0.1}:2150:2150" + - '${HOST_BIND:-127.0.0.1}:2150:2150' volumes: - type: bind source: ~/.srcbook @@ -16,4 +16,4 @@ services: - NODE_ENV=production - HOST=${HOST_BIND:-127.0.0.1} - SRCBOOK_INSTALL_DEPS=true - command: ["pnpm", "start"] \ No newline at end of file + command: ['pnpm', 'start'] diff --git a/packages/web/tailwind.config.js b/packages/web/tailwind.config.js index ceaaa635..64c63586 100644 --- a/packages/web/tailwind.config.js +++ b/packages/web/tailwind.config.js @@ -1,8 +1,13 @@ /** @type {import('tailwindcss').Config} */ -const plugin = require('tailwindcss/plugin'); -const path = require('path'); +import plugin from 'tailwindcss/plugin'; +import path from 'path'; +import { createRequire } from 'module'; +import animate from 'tailwindcss-animate'; -module.exports = { +// Create require function for resolving package paths +const require = createRequire(import.meta.url); + +export default { darkMode: ['class'], content: [ './index.html', @@ -219,5 +224,5 @@ module.exports = { }, }, }, - plugins: [require('tailwindcss-animate')], + plugins: [animate], };