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

React: Restore webpack as a dependency, updated webpack 5 docs #17207

Merged
merged 1 commit into from Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions MIGRATION.md
Expand Up @@ -607,6 +607,17 @@ yarn add webpack@5 --dev
npm install webpack@5 --save-dev
```

Alternatively or additionally you might need to add a resolution to your package.json to ensure that a consistent webpack version is provided across all of storybook packages. Replacing the {app} with the app (react, vue, etc.) that you're using:

```js
// package.json
...
resolutions: {
"@storybook/{app}/webpack": "^5"
}
...
```

### Angular 12 upgrade

Storybook 6.3 supports Angular 12 out of the box when you install it fresh. However, if you're upgrading your project from a previous version, you'll need to [follow the steps for opting-in to webpack 5](#webpack-5).
Expand Down
6 changes: 3 additions & 3 deletions app/react/package.json
Expand Up @@ -69,12 +69,12 @@
"react-refresh": "^0.11.0",
"read-pkg-up": "^7.0.1",
"regenerator-runtime": "^0.13.7",
"ts-dedent": "^2.0.0"
"ts-dedent": "^2.0.0",
"webpack": ">=4.43.0 <6.0.0"
},
"devDependencies": {
"@storybook/client-api": "6.5.0-alpha.14",
"@types/prompts": "^2.0.9",
"@types/webpack": "*"
"@types/prompts": "^2.0.9"
},
"peerDependencies": {
"@babel/core": "^7.11.5",
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Expand Up @@ -10770,7 +10770,6 @@ __metadata:
"@storybook/store": 6.5.0-alpha.14
"@types/node": ^14.14.20 || ^16.0.0
"@types/prompts": ^2.0.9
"@types/webpack": "*"
"@types/webpack-env": ^1.16.0
babel-plugin-add-react-displayname: ^0.0.5
babel-plugin-named-asset-import: ^0.3.1
Expand All @@ -10783,6 +10782,7 @@ __metadata:
read-pkg-up: ^7.0.1
regenerator-runtime: ^0.13.7
ts-dedent: ^2.0.0
webpack: ">=4.43.0 <6.0.0"
peerDependencies:
"@babel/core": ^7.11.5
react: ^16.8.0 || ^17.0.0
Expand Down Expand Up @@ -49163,7 +49163,7 @@ resolve@1.19.0:
languageName: node
linkType: hard

"webpack@npm:4, webpack@npm:^4.0.0":
"webpack@npm:4, webpack@npm:>=4.43.0 <6.0.0, webpack@npm:^4.0.0":
version: 4.46.0
resolution: "webpack@npm:4.46.0"
dependencies:
Expand Down