Skip to content

Commit 16f3a5a

Browse files
author
Amin Mahboubi
authored
Preserve modules for better tree shaking (#261)
* preserve modules for better tree shaking * update size-limit config
1 parent eeccc90 commit 16f3a5a

File tree

3 files changed

+8
-53
lines changed

3 files changed

+8
-53
lines changed

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
"author": "GetStream",
66
"license": "BSD-3-Clause",
77
"repository": "GetStream/react-activity-feed",
8-
"main": "dist/index.js",
9-
"module": "dist/index.es.js",
8+
"main": "dist/index.cjs.js",
9+
"module": "dist/index.js",
1010
"typings": "dist/index.d.ts",
11-
"jsnext:main": "dist/index.es.js",
11+
"jsnext:main": "dist/index.js",
1212
"jsdelivr": "dist/browser.full-bundle.js",
1313
"style": "dist/index.css",
14+
"sideEffects": false,
1415
"files": [
1516
"src",
1617
"dist"
@@ -28,7 +29,7 @@
2829
"lint": "yarn run prettier && yarn run eslint && stylelint '**/*.{css,scss}'",
2930
"lint-fix": "yarn run prettier-fix && yarn run eslint --fix && stylelint --fix '**/*.{css,scss}'",
3031
"stylelint": "stylelint '**/*.{css,scss}'",
31-
"types": "tsc --emitDeclarationOnly true",
32+
"types": "tsc",
3233
"build": "yarn run types && rollup -c",
3334
"start": "yarn run types && rollup -c -w",
3435
"docs": "docz dev",
@@ -104,7 +105,6 @@
104105
"react-dom": "^17.0.1",
105106
"react-test-renderer": "^17.0.2",
106107
"rollup": "^2.47.0",
107-
"rollup-plugin-copy": "^3.4.0",
108108
"rollup-plugin-node-globals": "^1.4.0",
109109
"rollup-plugin-peer-deps-external": "^2.2.4",
110110
"rollup-plugin-scss": "^2.6.1",
@@ -155,9 +155,8 @@
155155
],
156156
"size-limit": [
157157
{
158-
"path": "dist/index.es.js",
159-
"limit": "200 KB",
160-
"import": "{ createComponent }"
158+
"path": "dist/index.cjs.js",
159+
"limit": "270 KB"
161160
},
162161
{
163162
"path": "dist/index.css",

rollup.config.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import babel from '@rollup/plugin-babel';
33
import commonjs from '@rollup/plugin-commonjs';
44
import external from 'rollup-plugin-peer-deps-external';
55
import json from '@rollup/plugin-json';
6-
import copy from 'rollup-plugin-copy';
76
import resolve from '@rollup/plugin-node-resolve';
87
import globals from 'rollup-plugin-node-globals';
98
import scss from 'rollup-plugin-scss';
@@ -51,11 +50,6 @@ const normalBundle = {
5150
format: 'cjs',
5251
sourcemap: true,
5352
},
54-
{
55-
file: pkg.module,
56-
format: 'es',
57-
sourcemap: true,
58-
},
5953
],
6054
external: [
6155
/@babel/,
@@ -79,7 +73,6 @@ const normalBundle = {
7973
json(),
8074
external(),
8175
babel({ babelHelpers: 'runtime', exclude: 'node_modules/**', extensions }),
82-
copy({ targets: [{ src: 'src/i18n/*.json', dest: 'dist/i18n' }] }),
8376
],
8477
};
8578

yarn.lock

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,13 +2606,6 @@
26062606
resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7"
26072607
integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==
26082608

2609-
"@types/fs-extra@^8.0.1":
2610-
version "8.1.1"
2611-
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-8.1.1.tgz#1e49f22d09aa46e19b51c0b013cb63d0d923a068"
2612-
integrity sha512-TcUlBem321DFQzBNuz8p0CLLKp0VvF/XH9E4KHNmgwyp4E3AfgI5cjiIVZWlbfThBop2qxFIh4+LeY6hVWWZ2w==
2613-
dependencies:
2614-
"@types/node" "*"
2615-
26162609
"@types/get-port@^3.2.0":
26172610
version "3.2.0"
26182611
resolved "https://registry.yarnpkg.com/@types/get-port/-/get-port-3.2.0.tgz#f9e0a11443cc21336470185eae3dfba4495d29bc"
@@ -5154,7 +5147,7 @@ color@^3.0.0, color@^3.1.1:
51545147
color-convert "^1.9.1"
51555148
color-string "^1.5.4"
51565149

5157-
colorette@^1.1.0, colorette@^1.2.1, colorette@^1.2.2:
5150+
colorette@^1.2.1, colorette@^1.2.2:
51585151
version "1.2.2"
51595152
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
51605153
integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==
@@ -9059,20 +9052,6 @@ globals@^13.6.0:
90599052
dependencies:
90609053
type-fest "^0.20.2"
90619054

9062-
9063-
version "10.0.1"
9064-
resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.1.tgz#4782c34cb75dd683351335c5829cc3420e606b22"
9065-
integrity sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==
9066-
dependencies:
9067-
"@types/glob" "^7.1.1"
9068-
array-union "^2.1.0"
9069-
dir-glob "^3.0.1"
9070-
fast-glob "^3.0.3"
9071-
glob "^7.1.3"
9072-
ignore "^5.1.1"
9073-
merge2 "^1.2.3"
9074-
slash "^3.0.0"
9075-
90769055
[email protected], globby@^11.0.0, globby@^11.0.1, globby@^11.0.2, globby@^11.0.3:
90779056
version "11.0.3"
90789057
resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.3.tgz#9b1f0cb523e171dd1ad8c7b2a9fb4b644b9593cb"
@@ -10459,11 +10438,6 @@ is-plain-object@^2.0.3, is-plain-object@^2.0.4:
1045910438
dependencies:
1046010439
isobject "^3.0.1"
1046110440

10462-
is-plain-object@^3.0.0:
10463-
version "3.0.1"
10464-
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-3.0.1.tgz#662d92d24c0aa4302407b0d45d21f2251c85f85b"
10465-
integrity sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==
10466-
1046710441
is-potential-custom-element-name@^1.0.0:
1046810442
version "1.0.1"
1046910443
resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5"
@@ -16098,17 +16072,6 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
1609816072
hash-base "^3.0.0"
1609916073
inherits "^2.0.1"
1610016074

16101-
rollup-plugin-copy@^3.4.0:
16102-
version "3.4.0"
16103-
resolved "https://registry.yarnpkg.com/rollup-plugin-copy/-/rollup-plugin-copy-3.4.0.tgz#f1228a3ffb66ffad8606e2f3fb7ff23141ed3286"
16104-
integrity sha512-rGUmYYsYsceRJRqLVlE9FivJMxJ7X6jDlP79fmFkL8sJs7VVMSVyA2yfyL+PGyO/vJs4A87hwhgVfz61njI+uQ==
16105-
dependencies:
16106-
"@types/fs-extra" "^8.0.1"
16107-
colorette "^1.1.0"
16108-
fs-extra "^8.1.0"
16109-
globby "10.0.1"
16110-
is-plain-object "^3.0.0"
16111-
1611216075
rollup-plugin-node-globals@^1.4.0:
1611316076
version "1.4.0"
1611416077
resolved "https://registry.yarnpkg.com/rollup-plugin-node-globals/-/rollup-plugin-node-globals-1.4.0.tgz#5e1f24a9bb97c0ef51249f625e16c7e61b7c020b"

0 commit comments

Comments
 (0)