Skip to content

Commit

Permalink
chore(es5): add core-js to lib package
Browse files Browse the repository at this point in the history
  • Loading branch information
faris-imi committed Feb 8, 2024
1 parent 73af8dd commit 5ca4480
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 91 deletions.
6 changes: 4 additions & 2 deletions lib/esbuild.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,12 @@ if (WATCH) {
// Add Polyfills
await build({
...config,
entryPoints: [resolve(SRC, '../polyfills.js')],
format: 'cjs',
entryPoints: [resolve(SRC, 'polyfills.ts')],
outfile: resolve(DIST, 'polyfills.js'),
treeShaking: true,
target: [
'es5',
]
});

if (DEBUG) {
Expand Down
3 changes: 2 additions & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"test:unit": "jest"
},
"dependencies": {
"@sentry/browser": "^7.73.0"
"@sentry/browser": "^7.73.0",
"core-js": "^3.35.1"
},
"devDependencies": {
"@hcaptcha/types": "^1.0.3",
Expand Down
88 changes: 0 additions & 88 deletions lib/polyfills.js

This file was deleted.

4 changes: 4 additions & 0 deletions lib/src/polyfills.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import 'core-js/es/array/find';
import 'core-js/es/object/assign';
import 'core-js/es/object/entries';
import 'core-js/es/object/get-own-property-descriptors';
3 changes: 3 additions & 0 deletions lib/tsconfig.types.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@

"include": [
"src/**/*"
],
"exclude": [
"src/polyfills.ts"
]
}
12 changes: 12 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5ca4480

Please sign in to comment.