Skip to content

Commit b5f6c63

Browse files
committed
feat: drop core-js to reduce bundle size
re Donaldcwl#138
1 parent 909e24b commit b5f6c63

File tree

5 files changed

+72
-21
lines changed

5 files changed

+72
-21
lines changed

.babelrc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
22
"presets": [
33
["@babel/preset-env", {
4-
"useBuiltIns": "usage",
5-
"corejs": "3",
64
"targets": {
75
"browsers": ["> 5%", "ie 10-11", "not dead"]
86
}

lib/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import './polyfill';
2-
31
import compress from './image-compression';
42
import {
53
canvasToFile,

lib/polyfill.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "browser-image-compression",
3-
"version": "1.0.17",
3+
"version": "2.0.0",
44
"description": "Compress images in the browser",
55
"main": "dist/browser-image-compression.js",
66
"module": "dist/browser-image-compression.mjs",
@@ -39,7 +39,6 @@
3939
"dist"
4040
],
4141
"dependencies": {
42-
"core-js": "^3.16.1",
4342
"uzip": "0.20201231.0"
4443
},
4544
"devDependencies": {
@@ -69,7 +68,8 @@
6968
"rollup-plugin-copy": "^3.3.0",
7069
"rollup-plugin-license": "^2.0.0",
7170
"rollup-plugin-nodent": "^0.2.2",
72-
"rollup-plugin-terser": "^5.0.0"
71+
"rollup-plugin-terser": "^5.0.0",
72+
"rollup-plugin-visualizer": "^5.6.0"
7373
},
7474
"config": {
7575
"commitizen": {

yarn.lock

Lines changed: 69 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,11 +1505,9 @@ camelcase@^6.0.0:
15051505
integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==
15061506

15071507
caniuse-lite@^1.0.30001259:
1508-
version "1.0.30001260"
1509-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001260.tgz#e3be3f34ddad735ca4a2736fa9e768ef34316270"
1510-
integrity sha512-Fhjc/k8725ItmrvW5QomzxLeojewxvqiYCKeFcfFEhut28IVLdpHU19dneOmltZQIE5HNbawj1HYD+1f2bM1Dg==
1511-
dependencies:
1512-
nanocolors "^0.1.0"
1508+
version "1.0.30001327"
1509+
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001327.tgz"
1510+
integrity sha512-1/Cg4jlD9qjZzhbzkzEaAC2JHsP0WrOc8Rd/3a3LuajGzGWR/hD7TVyvq99VqmTy99eVh8Zkmdq213OgvgXx7w==
15131511

15141512
canvas@2.6.1:
15151513
version "2.6.1"
@@ -1751,11 +1749,6 @@ core-js@^2.6.5:
17511749
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec"
17521750
integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==
17531751

1754-
core-js@^3.16.1:
1755-
version "3.18.0"
1756-
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.18.0.tgz#9af3f4a6df9ba3428a3fb1b171f1503b3f40cc49"
1757-
integrity sha512-WJeQqq6jOYgVgg4NrXKL0KLQhi0CT4ZOCvFL+3CQ5o7I6J8HkT5wd53EadMfqTDp1so/MT1J+w2ujhWcCJtN7w==
1758-
17591752
core-util-is@1.0.2:
17601753
version "1.0.2"
17611754
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
@@ -1926,6 +1919,11 @@ default-require-extensions@^3.0.0:
19261919
dependencies:
19271920
strip-bom "^4.0.0"
19281921

1922+
define-lazy-prop@^2.0.0:
1923+
version "2.0.0"
1924+
resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f"
1925+
integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==
1926+
19291927
define-properties@^1.1.3:
19301928
version "1.1.3"
19311929
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
@@ -2951,6 +2949,11 @@ is-date-object@^1.0.1:
29512949
dependencies:
29522950
has-tostringtag "^1.0.0"
29532951

2952+
is-docker@^2.0.0, is-docker@^2.1.1:
2953+
version "2.2.1"
2954+
resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa"
2955+
integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==
2956+
29542957
is-extglob@^2.1.1:
29552958
version "2.1.1"
29562959
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
@@ -3073,6 +3076,13 @@ is-windows@^1.0.1, is-windows@^1.0.2:
30733076
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
30743077
integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==
30753078

3079+
is-wsl@^2.2.0:
3080+
version "2.2.0"
3081+
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271"
3082+
integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==
3083+
dependencies:
3084+
is-docker "^2.0.0"
3085+
30763086
isarray@~1.0.0:
30773087
version "1.0.0"
30783088
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
@@ -3619,7 +3629,7 @@ nan@^2.14.0:
36193629
resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee"
36203630
integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==
36213631

3622-
nanocolors@^0.1.0, nanocolors@^0.1.5:
3632+
nanocolors@^0.1.5:
36233633
version "0.1.12"
36243634
resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.1.12.tgz#8577482c58cbd7b5bb1681db4cf48f11a87fd5f6"
36253635
integrity sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ==
@@ -3629,6 +3639,11 @@ nanoid@3.1.25:
36293639
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.25.tgz#09ca32747c0e543f0e1814b7d3793477f9c8e152"
36303640
integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==
36313641

3642+
nanoid@^3.1.32:
3643+
version "3.3.2"
3644+
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.2.tgz#c89622fafb4381cd221421c69ec58547a1eec557"
3645+
integrity sha512-CuHBogktKwpm5g2sRgv83jEy2ijFzBwMoYA60orPDR7ynsLijJDqgsi4RDGj3OJpy3Ieb+LYwiRmIOGyytgITA==
3646+
36323647
natural-compare@^1.4.0:
36333648
version "1.4.0"
36343649
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
@@ -3862,6 +3877,15 @@ onetime@^2.0.0:
38623877
dependencies:
38633878
mimic-fn "^1.0.0"
38643879

3880+
open@^8.4.0:
3881+
version "8.4.0"
3882+
resolved "https://registry.yarnpkg.com/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8"
3883+
integrity sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==
3884+
dependencies:
3885+
define-lazy-prop "^2.0.0"
3886+
is-docker "^2.1.1"
3887+
is-wsl "^2.2.0"
3888+
38653889
optionator@^0.8.1:
38663890
version "0.8.3"
38673891
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495"
@@ -4451,6 +4475,16 @@ rollup-plugin-terser@^5.0.0:
44514475
serialize-javascript "^4.0.0"
44524476
terser "^4.6.2"
44534477

4478+
rollup-plugin-visualizer@^5.6.0:
4479+
version "5.6.0"
4480+
resolved "https://registry.yarnpkg.com/rollup-plugin-visualizer/-/rollup-plugin-visualizer-5.6.0.tgz#06aa7cf3fd504a29d404335700f2a3f28ebb33f3"
4481+
integrity sha512-CKcc8GTUZjC+LsMytU8ocRr/cGZIfMR7+mdy4YnlyetlmIl/dM8BMnOEpD4JPIGt+ZVW7Db9ZtSsbgyeBH3uTA==
4482+
dependencies:
4483+
nanoid "^3.1.32"
4484+
open "^8.4.0"
4485+
source-map "^0.7.3"
4486+
yargs "^17.3.1"
4487+
44544488
rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.8.2:
44554489
version "2.8.2"
44564490
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e"
@@ -4631,6 +4665,11 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:
46314665
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
46324666
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
46334667

4668+
source-map@^0.7.3:
4669+
version "0.7.3"
4670+
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383"
4671+
integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==
4672+
46344673
source-map@~0.2.0:
46354674
version "0.2.0"
46364675
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d"
@@ -4753,7 +4792,7 @@ string-width@^1.0.1:
47534792
is-fullwidth-code-point "^2.0.0"
47544793
strip-ansi "^4.0.0"
47554794

4756-
string-width@^4.1.0, string-width@^4.2.0:
4795+
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
47574796
version "4.2.3"
47584797
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
47594798
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -5309,6 +5348,11 @@ yargs-parser@^20.2.2:
53095348
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
53105349
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
53115350

5351+
yargs-parser@^21.0.0:
5352+
version "21.0.1"
5353+
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35"
5354+
integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==
5355+
53125356
yargs-unparser@2.0.0:
53135357
version "2.0.0"
53145358
resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb"
@@ -5349,6 +5393,19 @@ yargs@^15.0.2:
53495393
y18n "^4.0.0"
53505394
yargs-parser "^18.1.2"
53515395

5396+
yargs@^17.3.1:
5397+
version "17.4.1"
5398+
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.4.1.tgz#ebe23284207bb75cee7c408c33e722bfb27b5284"
5399+
integrity sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g==
5400+
dependencies:
5401+
cliui "^7.0.2"
5402+
escalade "^3.1.1"
5403+
get-caller-file "^2.0.5"
5404+
require-directory "^2.1.1"
5405+
string-width "^4.2.3"
5406+
y18n "^5.0.5"
5407+
yargs-parser "^21.0.0"
5408+
53525409
yocto-queue@^0.1.0:
53535410
version "0.1.0"
53545411
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"

0 commit comments

Comments
 (0)