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", + }, +});