Skip to content

Commit

Permalink
Bring back the docgen-plugin (#681)
Browse files Browse the repository at this point in the history
  • Loading branch information
vnys committed Nov 13, 2020
1 parent f7110fa commit 71d462d
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 36 deletions.
2 changes: 1 addition & 1 deletion libraries/core-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@types/react-dom": "^16.9.8",
"@types/styled-components": "^5.1.2",
"@types/testing-library__jest-dom": "^5.9.2",
"babel-plugin-react-docgen": "^4.1.0",
"babel-plugin-react-docgen": "^4.2.1",
"babel-plugin-styled-components": "^1.10.7",
"jest": "^26.0.1",
"jest-styled-components": "^6.3.4",
Expand Down
173 changes: 143 additions & 30 deletions libraries/core-react/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions libraries/core-react/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const globals = {
}

const extensions = ['.jsx', '.js', '.tsx', '.ts']

const buildForStorybook = process.env.STORYBOOK

export default [
{
input: './src/index.ts',
Expand All @@ -35,7 +38,10 @@ export default [
babelHelpers: 'bundled',
presets: ['@babel/preset-env', '@babel/preset-react'],
extensions,
plugins: ['babel-plugin-styled-components'],
plugins: [
'babel-plugin-styled-components',
...(buildForStorybook ? ['babel-plugin-react-docgen'] : []),
],
}),
commonjs(),
polyfill(['focus-visible']),
Expand All @@ -49,10 +55,7 @@ export default [
sourcemap: true,
globals,
},
{
file: pkg.main,
format: 'cjs',
},
...(buildForStorybook ? [] : [{ file: pkg.main, format: 'cjs' }]),
],
},
]

0 comments on commit 71d462d

Please sign in to comment.