Skip to content

Commit

Permalink
fix: store external module
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Jul 28, 2020
1 parent ae20846 commit e35d5ab
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/webpack-compile/src/externals-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const defaultExternals: ExternalProps[] = [
{ lib: '@theme-ui/css' },

{ lib: '@component-controls/core' },
{ lib: '@component-controls/loader' },
{ lib: '@component-controls/store' },
{ lib: '@component-controls/blocks' },
{ lib: '@component-controls/components' },

Expand Down
11 changes: 11 additions & 0 deletions examples/starter/.config/buildtime.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

module.exports = {
stories: [
'../src/docs/*.@(mdx|tsx)',
],
webpack: (config = {}, options = {}) => {
return {
...config,
plugins: [
...config.plugins,
// new BundleAnalyzerPlugin()
]
};
},
};
3 changes: 2 additions & 1 deletion examples/starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"gatsby": "^2.23.11",
"next": "^9.5.0",
"react": "^16.13.1",
"react-dom": "^16.13.1"
"react-dom": "^16.13.1",
"webpack-bundle-analyzer": "^3.8.0"
}
}
8 changes: 5 additions & 3 deletions examples/starter/src/docs/first-story.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from 'react';
import { useStore } from '@component-controls/store';
import { Button, ButtonProps } from '../components/Button';

export default {
title: 'Library/Components/Button',
};

export const overview = (props: ButtonProps) => (
<Button {...props}>click me</Button>
);
export const overview = (props: ButtonProps) => {
const store = useStore();
return <Button {...props}>{store.config.siteTitle}</Button>;
};

overview.component = Button;
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22325,7 +22325,7 @@ webidl-conversions@^4.0.2:
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==

webpack-bundle-analyzer@^3.7.0:
webpack-bundle-analyzer@^3.7.0, webpack-bundle-analyzer@^3.8.0:
version "3.8.0"
resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.8.0.tgz#ce6b3f908daf069fd1f7266f692cbb3bded9ba16"
integrity sha512-PODQhAYVEourCcOuU+NiYI7WdR8QyELZGgPvB1y2tjbUpbmcQOt5Q7jEK+ttd5se0KSBKD9SXHCEozS++Wllmw==
Expand Down

0 comments on commit e35d5ab

Please sign in to comment.