Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create-react-appでstorybookを利用する #16

Open
kurodakazumichi opened this issue Oct 21, 2018 · 4 comments
Open

create-react-appでstorybookを利用する #16

kurodakazumichi opened this issue Oct 21, 2018 · 4 comments

Comments

@kurodakazumichi
Copy link
Owner

グローバル空間を汚染せずに、プロジェクト内で完結させたい。

参考
https://storybook.js.org/basics/guide-react/

@kurodakazumichi
Copy link
Owner Author

参考サイトの手順通りに構築

  • npm install --save-dev @storybook/react
  • .storybook/config.jsを作成
  • index.jsを作成
  • package.jsonにコマンドを定義
npm run storybook
> react-lab@0.1.0 storybook /Users/kazumichi/work/React/react-lab
> start-storybook -p 9001 -c .storybook

info @storybook/react v3.4.11
info
info => Using default webpack setup based on "Create React App".
/Users/kazumichi/work/React/react-lab/node_modules/webpack/lib/DefinePlugin.js:93
                compiler.hooks.compilation.tap(
                               ^

TypeError: Cannot read property 'compilation' of undefined

というわけでエラーでうまくいかないです。

@kurodakazumichi
Copy link
Owner Author

storybookjs/storybook#3313

webpackの問題でうまくいかないっぽい?

@kurodakazumichi
Copy link
Owner Author

めんどくさくなったのでとりあえずグローバル汚染しつつもできるかやってみよう。

@kurodakazumichi
Copy link
Owner Author

npm install -g @storybook/cli
getstorybook
npm run storybook

storybookは起動したが

Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant