Skip to content

Commit

Permalink
feat: lazy compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
IanVS committed Apr 29, 2022
1 parent be33ccb commit aba9c98
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
9 changes: 8 additions & 1 deletion packages/react/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,17 @@ module.exports = {
'@storybook/addon-a11y',
],
core: {
builder: 'webpack5',
builder: {
name: 'webpack5',
options: {
lazyCompilation: true,
fsCache: true,
},
},
},
features: {
previewCsfV3: true,
storyStoreV7: true,
},
stories,
webpack(config) {
Expand Down
17 changes: 5 additions & 12 deletions packages/react/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { white, g10, g90, g100 } from '@carbon/themes';
import React from 'react';
import { breakpoints } from '@carbon/layout';
import { GlobalTheme } from '../src';
import { addParameters } from '@storybook/react';

export const globalTypes = {
locale: {
Expand Down Expand Up @@ -131,20 +130,14 @@ export const parameters = {
},
},
},
};

addParameters({
options: {
storySort: (storyA, storyB) => {
// By default, sort by the story "kind". The "kind" refers to the
// top-level title of the story, either through Component Story Format
// with the default export, or the `storiesOf('kind', module)` format
if (storyA[1].kind !== storyB[1].kind) {
return storyA[1].kind.localeCompare(storyB[1].kind);
if (storyA.title !== storyB.title) {
return storyA.title.localeCompare(storyB.title);
}

const idA = storyA[0];
const idB = storyB[0];
const idA = storyA.id;
const idB = storyB.id;

// To story the stories, we first build up a list of matches based on
// keywords. Each keyword has a specific weight that will be used to
Expand Down Expand Up @@ -199,7 +192,7 @@ addParameters({
return idA.localeCompare(idB);
},
},
});
};

configureActions({
depth: 3,
Expand Down

0 comments on commit aba9c98

Please sign in to comment.