Skip to content

Commit 585b033

Browse files
committed
docs: add polyfill example in entry configuration
1 parent bfc2eff commit 585b033

2 files changed

Lines changed: 23 additions & 50 deletions

File tree

src/content/configuration/entry-context.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,20 @@ export default {
156156
};
157157
```
158158
159+
### Example: Using Polyfills with Webpack
160+
161+
If you need to support older browsers, you can include polyfills in your entry configuration.
162+
163+
```js
164+
export default {
165+
entry: {
166+
main: ["core-js/stable", "regenerator-runtime/runtime", "./src/index.js"],
167+
},
168+
};
169+
```
170+
171+
This ensures that modern JavaScript features are available in environments that do not support them natively.
172+
159173
### Dynamic entry
160174
161175
If a function is passed then it will be invoked on every [make](/api/compiler-hooks/#make) event.

yarn.lock

Lines changed: 9 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3135,12 +3135,12 @@
31353135
"@typescript-eslint/types" "8.58.0"
31363136
"@typescript-eslint/visitor-keys" "8.58.0"
31373137

3138-
"@typescript-eslint/tsconfig-utils@8.54.0", "@typescript-eslint/tsconfig-utils@^8.54.0":
3138+
"@typescript-eslint/tsconfig-utils@8.54.0":
31393139
version "8.54.0"
31403140
resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.54.0.tgz#71dd7ba1674bd48b172fc4c85b2f734b0eae3dbc"
31413141
integrity sha512-dRgOyT2hPk/JwxNMZDsIXDgyl9axdJI3ogZ2XWhBPsnZUv+hPesa5iuhdYt2gzwA9t8RE5ytOJ6xB0moV0Ujvw==
31423142

3143-
"@typescript-eslint/tsconfig-utils@8.58.0", "@typescript-eslint/tsconfig-utils@^8.58.0":
3143+
"@typescript-eslint/tsconfig-utils@8.58.0", "@typescript-eslint/tsconfig-utils@^8.54.0", "@typescript-eslint/tsconfig-utils@^8.58.0":
31443144
version "8.58.0"
31453145
resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.58.0.tgz#c5a8edb21f31e0fdee565724e1b984171c559482"
31463146
integrity sha512-doNSZEVJsWEu4htiVC+PR6NpM+pa+a4ClH9INRWOWCUzMst/VA9c4gXq92F8GUD1rwhNvRLkgjfYtFXegXQF7A==
@@ -3156,12 +3156,12 @@
31563156
debug "^4.4.3"
31573157
ts-api-utils "^2.5.0"
31583158

3159-
"@typescript-eslint/types@8.54.0", "@typescript-eslint/types@^8.54.0":
3159+
"@typescript-eslint/types@8.54.0":
31603160
version "8.54.0"
31613161
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.54.0.tgz#c12d41f67a2e15a8a96fbc5f2d07b17331130889"
31623162
integrity sha512-PDUI9R1BVjqu7AUDsRBbKMtwmjWcn4J3le+5LpcFgWULN3LvHC5rkc9gCVxbrsrGmO1jfPybN5s6h4Jy+OnkAA==
31633163

3164-
"@typescript-eslint/types@8.58.0", "@typescript-eslint/types@^8.56.0", "@typescript-eslint/types@^8.58.0":
3164+
"@typescript-eslint/types@8.58.0", "@typescript-eslint/types@^8.54.0", "@typescript-eslint/types@^8.56.0", "@typescript-eslint/types@^8.58.0":
31653165
version "8.58.0"
31663166
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.58.0.tgz#e94ae7abdc1c6530e71183c1007b61fa93112a5a"
31673167
integrity sha512-O9CjxypDT89fbHxRfETNoAnHj/i6IpRK0CvbVN3qibxlLdo5p5hcLmUuCCrHMpxiWSwKyI8mCP7qRNYuOJ0Uww==
@@ -3196,7 +3196,7 @@
31963196
tinyglobby "^0.2.15"
31973197
ts-api-utils "^2.5.0"
31983198

3199-
"@typescript-eslint/utils@8.58.0":
3199+
"@typescript-eslint/utils@8.58.0", "@typescript-eslint/utils@^8.0.0":
32003200
version "8.58.0"
32013201
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.58.0.tgz#21a74a7963b0d288b719a4121c7dd555adaab3c3"
32023202
integrity sha512-RfeSqcFeHMHlAWzt4TBjWOAtoW9lnsAGiP3GbaX9uVgTYYrMbVnGONEfUCiSss+xMHFl+eHZiipmA8WkQ7FuNA==
@@ -3206,16 +3206,6 @@
32063206
"@typescript-eslint/types" "8.58.0"
32073207
"@typescript-eslint/typescript-estree" "8.58.0"
32083208

3209-
"@typescript-eslint/utils@^8.0.0":
3210-
version "8.54.0"
3211-
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.54.0.tgz#c79a4bcbeebb4f571278c0183ed1cb601d84c6c8"
3212-
integrity sha512-9Cnda8GS57AQakvRyG0PTejJNlA2xhvyNtEVIMlDWOOeEyBkYWhGPnfrIAnqxLMTSTo6q8g12XVjjev5l1NvMA==
3213-
dependencies:
3214-
"@eslint-community/eslint-utils" "^4.9.1"
3215-
"@typescript-eslint/scope-manager" "8.54.0"
3216-
"@typescript-eslint/types" "8.54.0"
3217-
"@typescript-eslint/typescript-estree" "8.54.0"
3218-
32193209
"@typescript-eslint/visitor-keys@8.54.0":
32203210
version "8.54.0"
32213211
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.54.0.tgz#0e4b50124b210b8600b245dd66cbad52deb15590"
@@ -4806,14 +4796,7 @@ copy-webpack-plugin@^14.0.0:
48064796
serialize-javascript "^7.0.3"
48074797
tinyglobby "^0.2.12"
48084798

4809-
core-js-compat@^3.48.0:
4810-
version "3.48.0"
4811-
resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.48.0.tgz#7efbe1fc1cbad44008190462217cc5558adaeaa6"
4812-
integrity sha512-OM4cAF3D6VtH/WkLtWvyNC56EZVXsZdU3iqaMG2B4WvYrlqU831pc4UtG5yp0sE9z8Y02wVN7PjW5Zf9Gt0f1Q==
4813-
dependencies:
4814-
browserslist "^4.28.1"
4815-
4816-
core-js-compat@^3.49.0:
4799+
core-js-compat@^3.48.0, core-js-compat@^3.49.0:
48174800
version "3.49.0"
48184801
resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.49.0.tgz#06145447d92f4aaf258a0c44f24b47afaeaffef6"
48194802
integrity sha512-VQXt1jr9cBz03b331DFDCCP90b3fanciLkgiOoy8SBHy06gNf+vQ1A3WFLqG7I8TipYIKeYK9wxd0tUrvHcOZA==
@@ -6197,12 +6180,7 @@ eslint-visitor-keys@^4.2.1:
61976180
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz#4cfea60fe7dd0ad8e816e1ed026c1d5251b512c1"
61986181
integrity sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==
61996182

6200-
eslint-visitor-keys@^5.0.0:
6201-
version "5.0.0"
6202-
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-5.0.0.tgz#b9aa1a74aa48c44b3ae46c1597ce7171246a94a9"
6203-
integrity sha512-A0XeIi7CXU7nPlfHS9loMYEKxUaONu/hTEzHTGba9Huu94Cq1hPivf+DE5erJozZOky0LfvXAyrV/tcswpLI0Q==
6204-
6205-
eslint-visitor-keys@^5.0.1:
6183+
eslint-visitor-keys@^5.0.0, eslint-visitor-keys@^5.0.1:
62066184
version "5.0.1"
62076185
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz#9e3c9489697824d2d4ce3a8ad12628f91e9f59be"
62086186
integrity sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==
@@ -9610,21 +9588,7 @@ mdast-util-to-hast@^13.0.0:
96109588
unist-util-visit "^5.0.0"
96119589
vfile "^6.0.0"
96129590

9613-
mdast-util-to-markdown@^2.0.0:
9614-
version "2.1.0"
9615-
resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz#9813f1d6e0cdaac7c244ec8c6dabfdb2102ea2b4"
9616-
integrity sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==
9617-
dependencies:
9618-
"@types/mdast" "^4.0.0"
9619-
"@types/unist" "^3.0.0"
9620-
longest-streak "^3.0.0"
9621-
mdast-util-phrasing "^4.0.0"
9622-
mdast-util-to-string "^4.0.0"
9623-
micromark-util-decode-string "^2.0.0"
9624-
unist-util-visit "^5.0.0"
9625-
zwitch "^2.0.0"
9626-
9627-
mdast-util-to-markdown@^2.1.0:
9591+
mdast-util-to-markdown@^2.0.0, mdast-util-to-markdown@^2.1.0:
96289592
version "2.1.2"
96299593
resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz#f910ffe60897f04bb4b7e7ee434486f76288361b"
96309594
integrity sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==
@@ -13565,12 +13529,7 @@ trough@^2.0.0:
1356513529
resolved "https://registry.yarnpkg.com/trough/-/trough-2.0.2.tgz#94a3aa9d5ce379fc561f6244905b3f36b7458d96"
1356613530
integrity sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==
1356713531

13568-
ts-api-utils@^2.4.0:
13569-
version "2.4.0"
13570-
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-2.4.0.tgz#2690579f96d2790253bdcf1ca35d569ad78f9ad8"
13571-
integrity sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==
13572-
13573-
ts-api-utils@^2.5.0:
13532+
ts-api-utils@^2.4.0, ts-api-utils@^2.5.0:
1357413533
version "2.5.0"
1357513534
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-2.5.0.tgz#4acd4a155e22734990a5ed1fe9e97f113bcb37c1"
1357613535
integrity sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==

0 commit comments

Comments
 (0)