Skip to content

Commit 90a6683

Browse files
author
Lars Roettig
committed
Add parcel to reduce the bundle size
1 parent 8025692 commit 90a6683

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ test-types.js
1212
docs/build/
1313
yarn.lock
1414
package-lock.json
15+
.npmrc

package.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "launchdarkly-react-client-sdk",
3-
"browserslist": ["last 2 versions", "ie >= 11"],
43
"version": "3.0.3",
54
"description": "LaunchDarkly SDK for React",
65
"author": "LaunchDarkly <[email protected]>",
@@ -26,6 +25,7 @@
2625
"test": "jest",
2726
"test:junit": "jest --ci --reporters=default --reporters=jest-junit",
2827
"build": "parcel build",
28+
"build:analyze": "parcel build --reporter @parcel/reporter-bundle-analyzer",
2929
"lint": "tslint -p tsconfig.json 'src/**/*.ts*'",
3030
"lint:all": "npm run lint",
3131
"check-typescript": "tsc",
@@ -41,6 +41,7 @@
4141
"homepage": "https://github.com/launchdarkly/react-client-sdk",
4242
"devDependencies": {
4343
"@parcel/packager-ts": "2.8.3",
44+
"@parcel/reporter-bundle-analyzer": "^2.8.3",
4445
"@parcel/transformer-typescript-types": "2.8.3",
4546
"@testing-library/jest-dom": "^5.16.4",
4647
"@testing-library/react": "^13.0.1",
@@ -67,12 +68,27 @@
6768
"typescript": "^4.5.3"
6869
},
6970
"dependencies": {
71+
"@swc/helpers": "^0.4.14",
7072
"hoist-non-react-statics": "^3.3.2",
7173
"launchdarkly-js-client-sdk": "^3.1.1",
7274
"lodash.camelcase": "^4.3.0"
7375
},
7476
"peerDependencies": {
7577
"react": "^16.6.3 || ^17.0.0 || ^18.0.0",
7678
"react-dom": "^16.8.4 || ^17.0.0 || ^18.0.0"
79+
},
80+
"targets": {
81+
"main": {
82+
"context": "browser",
83+
"outputFormat": "commonjs",
84+
"isLibrary": true,
85+
"optimize": true,
86+
"engines": {
87+
"browsers": [
88+
"> 0.5%, last 2 versions, not dead",
89+
"ie >= 11"
90+
]
91+
}
92+
}
7793
}
7894
}

0 commit comments

Comments
 (0)