Skip to content

Commit

Permalink
WIP: add lazy compilation config
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Mar 4, 2022
1 parent 0ef0fb2 commit c973a55
Show file tree
Hide file tree
Showing 5 changed files with 829 additions and 507 deletions.
26 changes: 25 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,37 @@ module.exports = {
'storybook-addon-designs',
'storybook-mobile',
],
// In case you'd like to disable docgen-typescript (70% Sealing typescript step)
// typescript: {
// reactDocgen: 'react-docgen',
// },
webpackFinal: (config) => {
// Preset CRA does not take these into consideration, gotta do it manually
return {
...config,
cache: {
type: 'filesystem',
},
experiments: {
lazyCompilation: {
entries: false,
},
},
}
},
staticDirs: ['../public'],
features: {
storyStoreV7: false,
storyStoreV7: true,

interactionsDebugger: true,
},
framework: '@storybook/react',
core: {
builder: 'webpack5',
// don't work in this project
options: {
fsCache: true,
lazyCompilation: true,
},
},
}
File renamed without changes.
14 changes: 14 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<style>
/* Temporary fix for elements flashing */
body > * {
display: none !important;
}

.sb-show-preparing-story > .sb-preparing-story,
.sb-show-preparing-docs > .sb-preparing-docs,
.sb-show-nopreview > .sb-nopreview,
.sb-show-errordisplay > .sb-errordisplay,
.sb-show-main > #root,
.sb-show-main > #docs-root {
display: block !important;
}

#root {
position: static;
}
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@
},
"devDependencies": {
"@babel/core": "^7.14.6",
"@storybook/addon-a11y": "^6.4.19",
"@storybook/addon-essentials": "^6.4.19",
"@storybook/addon-interactions": "^6.4.19",
"@storybook/addon-storyshots": "^6.4.19",
"@storybook/builder-webpack5": "^6.4.19",
"@storybook/addon-a11y": "^6.5.0-alpha.45",
"@storybook/addon-essentials": "^6.5.0-alpha.45",
"@storybook/addon-interactions": "^6.5.0-alpha.45",
"@storybook/addon-storyshots": "^6.5.0-alpha.45",
"@storybook/builder-webpack5": "^6.5.0-alpha.45",
"@storybook/jest": "^0.0.9",
"@storybook/manager-webpack5": "^6.4.19",
"@storybook/manager-webpack5": "^6.5.0-alpha.45",
"@storybook/preset-create-react-app": "^4.0.1",
"@storybook/react": "^6.4.19",
"@storybook/test-runner": "^0.0.4",
"@storybook/react": "^6.5.0-alpha.45",
"@storybook/test-runner": "^0.0.5-canary.cb8b66e.0",
"@storybook/testing-library": "^0.0.9",
"@storybook/testing-react": "^1.2.3",
"@testing-library/jest-dom": "^5.16.1",
Expand All @@ -85,13 +85,13 @@
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.27.1",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-storybook": "^0.5.6",
"eslint-plugin-storybook": "^0.5.7",
"husky": ">=6",
"jest-axe": "^4.1.0",
"jest-canvas-mock": "^2.3.1",
"lint-staged": ">=10",
"msw": "^0.36.0",
"msw-storybook-addon": "^1.6.0",
"msw-storybook-addon": "^1.6.1",
"prettier": "^2.5.0",
"react-is": "^17.0.2",
"react-test-renderer": "^17.0.2",
Expand Down
Loading

0 comments on commit c973a55

Please sign in to comment.