This repository has been archived by the owner on Dec 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from openscript-ch/migrate-to-vite-3
Migrate to vite 4
- Loading branch information
Showing
11 changed files
with
25,492 additions
and
34,291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,44 @@ | ||
const react = require("@vitejs/plugin-react"); | ||
|
||
module.exports = { | ||
stories: ["../stories/Start.stories.mdx", "../stories/**/*.stories.mdx", "../stories/**/*.stories.@(js|jsx|ts|tsx)"], | ||
staticDirs: [{ from: '../docs', to: '/docs'}], | ||
staticDirs: [{ | ||
from: '../docs', | ||
to: '/docs' | ||
}], | ||
addons: [{ | ||
name: '@storybook/addon-docs', | ||
options: { | ||
configureJSX: true, | ||
transcludeMarkdown: true | ||
} | ||
}, "@storybook/addon-links", "@storybook/addon-essentials", "@storybook/addon-storysource"], | ||
core: { | ||
"builder": "@storybook/builder-vite" | ||
}, | ||
|
||
async viteFinal(config, { | ||
configType | ||
}) { | ||
config.plugins = config.plugins.filter(plugin => !(Array.isArray(plugin) && plugin[0]?.name.includes("vite:react"))); | ||
|
||
if (config.optimizeDeps) { | ||
config.optimizeDeps.include = [...(config.optimizeDeps.include || []), '@emotion/react/jsx-dev-runtime']; | ||
} | ||
|
||
config.plugins.push(react({ | ||
exclude: [/\.stories\.(t|j)sx?$/, /node_modules/], | ||
jsxImportSource: "@emotion/react", | ||
babel: { | ||
plugins: ["@emotion/babel-plugin"] | ||
} | ||
})); | ||
|
||
if (configType === "PRODUCTION") { | ||
return { ...config, | ||
return { | ||
...config, | ||
base: './' | ||
}; | ||
} | ||
|
||
return config; | ||
}, | ||
framework: { | ||
name: "@storybook/react-vite", | ||
options: {} | ||
}, | ||
docs: { | ||
docsPage: "automatic" | ||
} | ||
|
||
}; | ||
}; |
Oops, something went wrong.