diff --git a/.size-limit b/.size-limit index 1acb8f2e9..8cc9aee9d 100644 --- a/.size-limit +++ b/.size-limit @@ -3,6 +3,6 @@ name: "Fundamental-React Size", webpack: true, path: "lib/index.js", - limit: "175 KB" + limit: "150 KB" } ] diff --git a/.storybook/addons.js b/.storybook/addons.js new file mode 100644 index 000000000..292c053ff --- /dev/null +++ b/.storybook/addons.js @@ -0,0 +1,4 @@ +import '@storybook/addon-knobs/register'; +import '@storybook/addon-a11y/register'; +import '@storybook/addon-storysource/register'; +import '@storybook/addon-notes/register'; diff --git a/.storybook/config.js b/.storybook/config.js new file mode 100644 index 000000000..035d56567 --- /dev/null +++ b/.storybook/config.js @@ -0,0 +1,11 @@ +import { addDecorator, configure } from '@storybook/react'; +import { withA11y } from '@storybook/addon-a11y'; + +addDecorator(withA11y); + +function loadStories() { + const req = require.context('../src', true, /\.stories\.js$/); + req.keys().forEach(filename => req(filename)); +} + +configure(loadStories, module); diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js new file mode 100644 index 000000000..c7cabe7fc --- /dev/null +++ b/.storybook/webpack.config.js @@ -0,0 +1,10 @@ +const path = require('path'); + +module.exports = function({ config }) { + config.module.rules.push({ + test: /\.stories\.js?$/, + loaders: [require.resolve('@storybook/source-loader')], + enforce: 'pre', + }); + return config; +}; diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index d3b21c17e..b180b9ea2 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -251,6 +251,7 @@ module.exports = { }, { test: cssRegex, + exclude: [/customStylesTest/], loader: getStyleLoaders({ importLoaders: 1, sourceMap: shouldUseSourceMap @@ -280,7 +281,7 @@ module.exports = { ] }, plugins: [ - // Generates an `index.html` file with the