Skip to content

Commit

Permalink
fix storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
jsladerman committed Nov 26, 2024
1 parent 437fb2a commit 1fad4d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
],
"scripts": {
"start": "storybook dev -p 6006",
"build:storybook": "yarn clean && storybook build && yarn build:fix:storybook",
"build:storybook": "yarn build && storybook build && yarn build:fix:storybook",
"build:fix:storybook": "perl -pi -w -e 's/%40/@/g;' storybook-static/index.html",
"storybook:serve-static": "yarn build:storybook && http-server storybook-static",
"build": "tsc --noEmit && vite build",
"build:watch": "vite build --watch",
"build": "rimraf dist && tsc --noEmit && vite build",
"build:watch": "rimraf dist && vite build --watch",
"clean": "rimraf storybook-static dist",
"test": "vitest --run",
"test:watch": "vitest",
Expand Down
11 changes: 8 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import dts from 'vite-plugin-dts'
export default defineConfig({
build: {
lib: {
entry: { index: resolve(__dirname, 'src/index.ts') },
entry: resolve(__dirname, 'src/index.ts'),
formats: ['es', 'cjs'],
fileName: (format, entryName) => `${entryName}.${format}.js`,
fileName: (format) => `index.${format}.js`,
},
rollupOptions: {
external: [
Expand Down Expand Up @@ -38,7 +38,12 @@ export default defineConfig({
}),
dts({
insertTypesEntry: true,
rollupTypes: true,
include: ['src'],
exclude: ['**/*.stories.tsx', '**/*.test.tsx'],
beforeWriteFile: (filePath, content) => ({
filePath: filePath.replace(/src/, 'dist'),
content,
}),
}),
],
optimizeDeps: {
Expand Down

0 comments on commit 1fad4d2

Please sign in to comment.