Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Storybook 8 and switched to vite bundler #77

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .storybook/local-presets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* to load the built addon in this test Storybook
*/

function managerEntries(entry = []) {
return [...entry, require.resolve('../dist/esm/manager.js')];
}

module.exports = {
managerEntries,
};
8 changes: 0 additions & 8 deletions .storybook/main.js

This file was deleted.

23 changes: 23 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export default {
stories: ['../stories/**/*.stories.tsx'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'./local-presets.js',
],
core: {
builder: '@storybook/builder-vite',
},
framework: '@storybook/react-vite',
async viteFinal(config) {
// Merge custom configuration into the default config
const { mergeConfig } = await import('vite');

return mergeConfig(config, {
// Add dependencies to pre-optimization
optimizeDeps: {
include: ['storybook-dark-mode'],
},
});
},
};
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cSpell.words": ["formik"]
}
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
testEnvironment: 'jsdom',
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
setupFilesAfterEnv: ['@testing-library/jest-dom']
setupFilesAfterEnv: ['@testing-library/jest-dom'],
};
1 change: 1 addition & 0 deletions manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './dist/esm/manager';
Loading
Loading