Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.

Commit a7d447f

Browse files
committed
Use react-pdf png-js build
1 parent 59df416 commit a7d447f

4 files changed

Lines changed: 8 additions & 11 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
],
2323
"dependencies": {
2424
"@react-pdf/fontkit": "^1.11.0",
25-
"png-js": ">=0.1.0"
25+
"@react-pdf/png-js": "^1.0.0"
2626
},
2727
"devDependencies": {
2828
"babel-plugin-external-helpers": "^6.22.0",

rollup.config.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ const configBase = {
3232
runtimeHelpers: true
3333
})
3434
],
35-
external: [].concat(
36-
Object.keys(pkg.dependencies)
37-
)
35+
external: Object.keys(pkg.dependencies)
3836
}
3937

4038
const serverConfig = Object.assign({}, configBase, {
@@ -67,8 +65,7 @@ const browserConfig = Object.assign({}, configBase, {
6765
],
6866
plugins: configBase.plugins.concat(
6967
replace({
70-
BROWSER: JSON.stringify(true),
71-
"png-js": "png-js/png.js"
68+
BROWSER: JSON.stringify(true)
7269
}),
7370
ignore(['fs'])
7471
)

src/image/png.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import zlib from 'zlib';
2-
const PNG = require('png-js');
2+
import PNG from '@react-pdf/png-js';
33

44
class PNGImage {
55
constructor(data, label) {

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
tiny-inflate "^1.0.2"
1818
unicode-trie "^0.3.0"
1919

20+
"@react-pdf/png-js@^1.0.0":
21+
version "1.0.0"
22+
resolved "https://registry.yarnpkg.com/@react-pdf/png-js/-/png-js-1.0.0.tgz#00fcb969dca4ce82a0a7673413ade039e47b361e"
23+
2024
"@react-pdf/unicode-properties@^2.2.0":
2125
version "2.2.0"
2226
resolved "https://registry.yarnpkg.com/@react-pdf/unicode-properties/-/unicode-properties-2.2.0.tgz#f109eaac244ceb108011d4038cee4cc787cb40f3"
@@ -1040,10 +1044,6 @@ path-parse@^1.0.5:
10401044
version "1.0.5"
10411045
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
10421046

1043-
png-js@>=0.1.0:
1044-
version "0.1.1"
1045-
resolved "https://registry.yarnpkg.com/png-js/-/png-js-0.1.1.tgz#1cc7c212303acabe74263ec3ac78009580242d93"
1046-
10471047
prelude-ls@~1.1.2:
10481048
version "1.1.2"
10491049
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"

0 commit comments

Comments
 (0)