From 3640027d2b45750105f4a3053fe8faff37bef207 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Tue, 20 Aug 2024 15:57:59 +0200 Subject: [PATCH] Change build instructions --- .gitignore | 3 ++- README.md | 14 ++++++++++++++ package.json | 2 +- .vite-env.d.ts => vite-env.d.ts | 0 vite.config.ts | 8 ++++++++ 5 files changed, 25 insertions(+), 2 deletions(-) rename .vite-env.d.ts => vite-env.d.ts (100%) create mode 100644 vite.config.ts diff --git a/.gitignore b/.gitignore index b512c09..eff5dde 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -node_modules \ No newline at end of file +node_modules +storybook-static \ No newline at end of file diff --git a/README.md b/README.md index 865e889..14f44be 100644 --- a/README.md +++ b/README.md @@ -26,3 +26,17 @@ npm install ``` npm run storybook ``` + +## Build (for deployment) + +``` +npm run build-storybook +``` + +The files are generated under the folder storybook-static. + +You can preview by using the command: + +``` +npm run preview +``` diff --git a/package.json b/package.json index d08cf68..478b81d 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "type": "module", "scripts": { "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", - "preview": "vite preview", + "preview": "npx http-server ./storybook-static", "format": "prettier --write ./src", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build" diff --git a/.vite-env.d.ts b/vite-env.d.ts similarity index 100% rename from .vite-env.d.ts rename to vite-env.d.ts diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..7638414 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +// https://vitejs.dev/config/ +export default defineConfig({ + worker: { + format: "es", + }, +});