From deef8abca5d9936afcb85896ba6f344947b9aee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bel=C3=A9n=20Albeza?= Date: Thu, 1 Aug 2024 10:44:44 +0200 Subject: [PATCH] :wrench: Enable storybook to be served from a subdir --- docker/devenv/files/nginx.conf | 5 +++++ frontend/package.json | 1 + frontend/vite.config.js | 7 +++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docker/devenv/files/nginx.conf b/docker/devenv/files/nginx.conf index 05df881bd..961b3a4fb 100644 --- a/docker/devenv/files/nginx.conf +++ b/docker/devenv/files/nginx.conf @@ -149,6 +149,11 @@ http { proxy_pass http://127.0.0.1:6060/ws/notifications; } + location /storybook { + alias /home/penpot/penpot/frontend/storybook-static/; + autoindex on; + } + location / { location ~ ^/github/penpot-files/(?[a-zA-Z0-9\-\_\.]+) { proxy_pass https://raw.githubusercontent.com/penpot/penpot-files/main/$template_file; diff --git a/frontend/package.json b/frontend/package.json index 9a527d9c0..fee783f99 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -36,6 +36,7 @@ "e2e:server": "node ./scripts/e2e-server.js", "e2e:test": "playwright test --project default", "storybook:compile": "yarn run compile && clojure -M:dev:shadow-cljs compile storybook", + "storybook:release": "yarn run compile && clojure -M:dev:shadow-cljs compile storybook && yarn run storybook build", "storybook:server": "yarn run storybook dev -p 6006 --no-open", "storybook:watch": "concurrently \"clojure -M:dev:shadow-cljs watch storybook\" \"yarn run storybook:server\" \"yarn run watch\"", "storybook:build": "yarn run storybook:compile && storybook build" diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 119e8e7aa..12cc3eeb8 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -1,15 +1,14 @@ import { defineConfig } from "vite"; -import { configDefaults } from 'vitest/config' +import { configDefaults } from "vitest/config"; import { resolve } from "path"; // https://vitejs.dev/config/ export default defineConfig({ test: { - exclude: [...configDefaults.exclude, 'target/**', 'resources/**'], - environment: 'jsdom' + exclude: [...configDefaults.exclude, "target/**", "resources/**"], + environment: "jsdom", }, - resolve: { alias: { "@target": resolve(__dirname, "./target/storybook"),