Skip to content

Commit

Permalink
[aksel.nav.no] Change to Vite framework
Browse files Browse the repository at this point in the history
  • Loading branch information
HalvorHaugan committed Oct 1, 2024
1 parent b1b0d23 commit a6790c4
Show file tree
Hide file tree
Showing 3 changed files with 324 additions and 1,289 deletions.
22 changes: 7 additions & 15 deletions aksel.nav.no/website/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { loadCsf } from "@storybook/csf-tools";
import type { StorybookConfig } from "@storybook/nextjs";
import type { StorybookConfig } from "@storybook/experimental-nextjs-vite";
import { readFileSync } from "fs";
import { resolve } from "path";
import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin";
import TsconfigPathsPlugin from "vite-tsconfig-paths";

const indexRegex = /export const args = {\s+index: (\d+),/;

Expand Down Expand Up @@ -60,20 +59,13 @@ const sbConfig: StorybookConfig = {
"@storybook/addon-interactions",
"@storybook/addon-a11y",
],
framework: "@storybook/nextjs",
framework: "@storybook/experimental-nextjs-vite",
docs: {
autodocs: "tag",
},
webpackFinal: (async (config) => {
if (!config?.resolve) {
return config;
}
config.resolve.plugins = [
new TsconfigPathsPlugin({
configFile: resolve(__dirname, "../tsconfig.json"),
}),
];
return config;
}) satisfies StorybookConfig["webpackFinal"],
viteFinal: async (config) => {
const { mergeConfig } = await import("vite");
return mergeConfig(config, { plugins: [TsconfigPathsPlugin()] });
},
};
export default sbConfig;
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,18 @@
"devDependencies": {
"@biomejs/biome": "1.8.0",
"@changesets/cli": "2.26.2",
"@storybook/addon-a11y": "^8.3.0",
"@storybook/addon-essentials": "^8.3.0",
"@storybook/addon-interactions": "^8.3.0",
"@storybook/addon-storysource": "^8.3.0",
"@storybook/blocks": "^8.3.0",
"@storybook/csf-tools": "^8.3.0",
"@storybook/manager-api": "^8.3.0",
"@storybook/nextjs": "^8.3.0",
"@storybook/react": "^8.3.0",
"@storybook/react-vite": "^8.3.0",
"@storybook/test": "^8.3.0",
"@storybook/theming": "^8.3.0",
"@storybook/addon-a11y": "^8.3.4",
"@storybook/addon-essentials": "^8.3.4",
"@storybook/addon-interactions": "^8.3.4",
"@storybook/addon-storysource": "^8.3.4",
"@storybook/blocks": "^8.3.4",
"@storybook/csf-tools": "^8.3.4",
"@storybook/experimental-nextjs-vite": "^8.3.4",
"@storybook/manager-api": "^8.3.4",
"@storybook/react": "^8.3.4",
"@storybook/react-vite": "^8.3.4",
"@storybook/test": "^8.3.4",
"@storybook/theming": "^8.3.4",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@typescript-eslint/eslint-plugin": "^7.18.0",
Expand All @@ -171,7 +171,7 @@
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-storybook": "^0.8.0",
"eslint-plugin-storybook": "^0.9.0",
"eslint-plugin-testing-library": "^6.0.2",
"fast-glob": "3.2.11",
"husky": "^8.0.0",
Expand All @@ -182,7 +182,7 @@
"react-docgen-typescript": "2.2.2",
"react-dom": "^18.0.0",
"react-syntax-highlighter": "^15.5.0",
"storybook": "^8.3.0",
"storybook": "^8.3.4",
"storybook-addon-pseudo-states": "^4.0.2",
"stylelint": "^14.8.5",
"stylelint-config-prettier": "^9.0.3",
Expand Down
Loading

0 comments on commit a6790c4

Please sign in to comment.