Skip to content

Commit

Permalink
[breaking] Make file-loader a peerDependency (#970)
Browse files Browse the repository at this point in the history
Co-Authored-By: Wojciech Maj <kontakt@wojtekmaj.pl>
  • Loading branch information
rpaasche and wojtekmaj committed Jul 27, 2022
1 parent 3e44ed9 commit 633dfb1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 41 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ import { Document, Page } from 'react-pdf/dist/esm/entry.webpack';
| Webpack 4 | `react-pdf/dist/esm/entry.webpack` |
| Webpack 5 | `react-pdf/dist/esm/entry.webpack5` |

#### Webpack 4

If you want to use React-PDF with Webpack 4, you'll need to manually install `file-loader` package.

#### Create React App

Create React App 4 (`react-scripts@4.0.0`) uses Webpack 4 under the hood, so you can use the entry file built for Webpack 4.
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.0.0",
"file-loader": "^6.0.0",
"make-cancellable-promise": "^1.0.0",
"make-event-props": "^1.1.0",
"merge-class-names": "^1.1.1",
Expand Down Expand Up @@ -103,9 +102,15 @@
"webpack": "^5.20.0"
},
"peerDependencies": {
"file-loader": "^6.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"peerDependenciesMeta": {
"file-loader": {
"optional": true
}
},
"resolutions": {
"semver@7.0.0": "^7.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion test/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5429,7 +5429,6 @@ __metadata:
resolution: "react-pdf@portal:../::locator=react-pdf-test-page%40workspace%3A."
dependencies:
"@babel/runtime": ^7.0.0
file-loader: ^6.0.0
make-cancellable-promise: ^1.0.0
make-event-props: ^1.1.0
merge-class-names: ^1.1.1
Expand All @@ -5439,6 +5438,7 @@ __metadata:
tiny-invariant: ^1.0.0
tiny-warning: ^1.0.0
peerDependencies:
file-loader: ^6.0.0
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
languageName: node
Expand Down
44 changes: 5 additions & 39 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2595,13 +2595,6 @@ __metadata:
languageName: node
linkType: hard

"big.js@npm:^5.2.2":
version: 5.2.2
resolution: "big.js@npm:5.2.2"
checksum: b89b6e8419b097a8fb4ed2399a1931a68c612bce3cfd5ca8c214b2d017531191070f990598de2fc6f3f993d91c0f08aa82697717f6b3b8732c9731866d233c9e
languageName: node
linkType: hard

"binary-extensions@npm:^2.0.0":
version: 2.2.0
resolution: "binary-extensions@npm:2.2.0"
Expand Down Expand Up @@ -3213,13 +3206,6 @@ __metadata:
languageName: node
linkType: hard

"emojis-list@npm:^3.0.0":
version: 3.0.0
resolution: "emojis-list@npm:3.0.0"
checksum: ddaaa02542e1e9436c03970eeed445f4ed29a5337dfba0fe0c38dfdd2af5da2429c2a0821304e8a8d1cadf27fdd5b22ff793571fa803ae16852a6975c65e8e70
languageName: node
linkType: hard

"encoding@npm:^0.1.13":
version: 0.1.13
resolution: "encoding@npm:0.1.13"
Expand Down Expand Up @@ -3716,18 +3702,6 @@ __metadata:
languageName: node
linkType: hard

"file-loader@npm:^6.0.0":
version: 6.2.0
resolution: "file-loader@npm:6.2.0"
dependencies:
loader-utils: ^2.0.0
schema-utils: ^3.0.0
peerDependencies:
webpack: ^4.0.0 || ^5.0.0
checksum: faf43eecf233f4897b0150aaa874eeeac214e4f9de49738a9e0ef734a30b5260059e85b7edadf852b98e415f875bd5f12587768a93fd52aaf2e479ecf95fab20
languageName: node
linkType: hard

"fill-range@npm:^7.0.1":
version: 7.0.1
resolution: "fill-range@npm:7.0.1"
Expand Down Expand Up @@ -5160,17 +5134,6 @@ __metadata:
languageName: node
linkType: hard

"loader-utils@npm:^2.0.0":
version: 2.0.2
resolution: "loader-utils@npm:2.0.2"
dependencies:
big.js: ^5.2.2
emojis-list: ^3.0.0
json5: ^2.1.2
checksum: 9078d1ed47cadc57f4c6ddbdb2add324ee7da544cea41de3b7f1128e8108fcd41cd3443a85b7ee8d7d8ac439148aa221922774efe4cf87506d4fb054d5889303
languageName: node
linkType: hard

"locate-path@npm:^2.0.0":
version: 2.0.0
resolution: "locate-path@npm:2.0.0"
Expand Down Expand Up @@ -6068,7 +6031,6 @@ __metadata:
"@testing-library/react": ^12.1.0
eslint: ^8.5.0
eslint-config-wojtekmaj: ^0.6.5
file-loader: ^6.0.0
husky: ^8.0.0
jest: ^27.0.0
jest-canvas-mock: ^2.3.1
Expand All @@ -6087,8 +6049,12 @@ __metadata:
tiny-warning: ^1.0.0
webpack: ^5.20.0
peerDependencies:
file-loader: ^6.0.0
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
peerDependenciesMeta:
file-loader:
optional: true
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -6354,7 +6320,7 @@ __metadata:
languageName: node
linkType: hard

"schema-utils@npm:^3.0.0, schema-utils@npm:^3.1.0, schema-utils@npm:^3.1.1":
"schema-utils@npm:^3.1.0, schema-utils@npm:^3.1.1":
version: 3.1.1
resolution: "schema-utils@npm:3.1.1"
dependencies:
Expand Down

0 comments on commit 633dfb1

Please sign in to comment.