Skip to content

Commit 917c693

Browse files
committed
2 parents 6536001 + 8c74c7d commit 917c693

30 files changed

Lines changed: 3544 additions & 3817 deletions

src/content/blog/2020-10-10-webpack-5-release.mdx

Lines changed: 869 additions & 870 deletions
Large diffs are not rendered by default.

src/content/blog/2020-12-08-roadmap-2021.mdx

Lines changed: 138 additions & 137 deletions
Large diffs are not rendered by default.

src/content/blog/2026-02-03-webpack-5-105.mdx

Lines changed: 68 additions & 69 deletions
Large diffs are not rendered by default.

src/content/blog/2026-02-04-roadmap-2026.mdx

Lines changed: 80 additions & 81 deletions
Large diffs are not rendered by default.

src/content/blog/2026-04-08-webpack-5-106.mdx

Lines changed: 77 additions & 76 deletions
Large diffs are not rendered by default.

src/content/blog/index.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
2-
title: Blog
2+
title: المدونة
33
sort: -1
44
contributors:
5-
- sokra
5+
- ameencfw
6+
- RlxChap2
67
---
78

8-
Read here for announcements.
9+
اقرأ الإعلانات هنا.
910

10-
See recent blog posts in the side bar.
11+
شاهد أحدث مقالات المدونة في الشريط الجانبي.

src/content/configuration/cache.mdx

Lines changed: 80 additions & 85 deletions
Large diffs are not rendered by default.

src/content/configuration/configuration-languages.mdx

Lines changed: 33 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,23 @@
11
---
2-
title: Configuration Languages
2+
title: لغات التخصيص
33
sort: 2
44
contributors:
5-
- piouson
6-
- sokra
7-
- skipjack
8-
- tarang9211
9-
- simon04
10-
- peterblazejewicz
11-
- youta1119
12-
- byzyk
13-
- Nek-
14-
- liyiming22
15-
- daimalou
16-
- ChocolateLoverRaj
17-
- snitin315
5+
- RlxChap2
186
---
197

20-
Webpack accepts configuration files written in multiple programming and data languages. The list of supported file extensions can be found in the [node-interpret](https://github.com/gulpjs/interpret) package. Using [node-interpret](https://github.com/gulpjs/interpret), webpack can handle many different types of configuration files.
8+
يقبل webpack ملفات تخصيص مكتوبة بعدّة لغات برمجة ولغات بيانات. تجد قائمة بامتدادات الملفات المدعومة في حزمة [node-interpret](https://github.com/gulpjs/interpret). فعبر [node-interpret](https://github.com/gulpjs/interpret)، يستطيع webpack التعامل مع أنواع كثيرة ومختلفة من ملفات التخصيص.
219

2210
## TypeScript
2311

24-
To write the webpack configuration in [TypeScript](http://www.typescriptlang.org/), you would first install the necessary dependencies, i.e., TypeScript and the relevant type definitions from the [DefinitelyTyped](https://definitelytyped.org/) project:
12+
لكتابة تخصيص webpack بلغة [TypeScript](http://www.typescriptlang.org/)، ثبّت أوّلاً الاعتماديات اللازمة، وهي TypeScript وتعريفات الأنواع ذات الصلة من مشروع [DefinitelyTyped](https://definitelytyped.org/):
2513

2614
```bash
2715
npm install --save-dev typescript ts-node @types/node
28-
# and, if using webpack-dev-server < v4.7.0
16+
# وإن كنت تستخدم webpack-dev-server بإصدار أقل من v4.7.0
2917
npm install --save-dev @types/webpack-dev-server
3018
```
3119

32-
and then proceed to write your configuration:
20+
ثم ابدأ بكتابة التخصيص:
3321

3422
**webpack.config.ts**
3523

@@ -38,7 +26,7 @@ import path from "node:path";
3826
import { fileURLToPath } from "node:url";
3927

4028
import webpack from "webpack";
41-
// in case you run into any typescript error when configuring `devServer`
29+
// في حال واجهتك أخطاء TypeScript عند تخصيص `devServer`
4230
import "webpack-dev-server";
4331

4432
const __filename = fileURLToPath(import.meta.url);
@@ -69,31 +57,31 @@ export default config;
6957
"resolveJsonModule": true,
7058
"isolatedModules": true,
7159

72-
// Allows you to write `import ... from './file.ts';`
60+
// يتيح لك كتابة `import ... from './file.ts';`
7361
"rewriteRelativeImportExtensions": true
7462
}
7563
}
7664
```
7765

78-
The above sample assumes version >= 2.7 or newer of TypeScript is used with the new `esModuleInterop` and `allowSyntheticDefaultImports` compiler options in your `tsconfig.json` file.
66+
يفترض المثال السابق أنّك تستخدم إصدار TypeScript رقم 2.7 أو أحدث، مع تفعيل خياري `esModuleInterop` و `allowSyntheticDefaultImports` في ملف `tsconfig.json`.
7967

80-
We support configuration in both `CommonJS` and `ESM` format.
68+
ندعم التخصيص بصيغة `CommonJS` و `ESM` معاً.
8169

82-
Starting with v22.18.0 Node.js supports built-in [type stripping](https://nodejs.org/api/typescript.html#type-stripping), so the additional settings described below are only required for older versions.
70+
بدءاً من الإصدار v22.18.0، أصبح Node.js يدعم [إزالة الأنواع (type stripping)](https://nodejs.org/api/typescript.html#type-stripping) بشكل أصلي، ولذلك فإنّ الإعدادات الإضافية الموضّحة أدناه ليست مطلوبة إلا للإصدارات الأقدم.
8371

84-
> To enable the transformation of non erasable TypeScript syntax, which requires JavaScript code generation, such as enum declarations, parameter properties use the flag [--experimental-transform-types](https://nodejs.org/api/cli.html#experimental-transform-types).
72+
> لتفعيل تحويل صياغات TypeScript غير القابلة للحذف، التي تحتاج إلى توليد شيفرة JavaScript مثل تصريحات `enum` وخصائص المُعاملات (parameter properties)، استخدم الراية [--experimental-transform-types](https://nodejs.org/api/cli.html#experimental-transform-types).
8573
86-
If you are using an older version of Node.js that does not support the `typescript` format, or want to set `module` in `compilerOptions` in `tsconfig.json` to `commonjs` there are three solutions to this issue:
74+
إذا كنت تستخدم إصداراً أقدم من Node.js لا يدعم صيغة `typescript`، أو أردت ضبط `module` في `compilerOptions` ضمن `tsconfig.json` على `commonjs`، فأمامك ثلاثة حلول لهذه المشكلة:
8775

88-
- Modify `tsconfig.json`.
89-
- Modify `tsconfig.json` and add settings for `ts-node`.
90-
- Install `tsconfig-paths`.
76+
- تعديل `tsconfig.json`.
77+
- تعديل `tsconfig.json` وإضافة إعدادات خاصة بـ `ts-node`.
78+
- تثبيت `tsconfig-paths`.
9179

92-
The **first option** is to open your `tsconfig.json` file and look for `compilerOptions`. Set `target` to `"ES5"` and `module` to `"CommonJS"` (or completely remove the `module` option).
80+
**الحلّ الأول**: افتح ملف `tsconfig.json` وابحث عن `compilerOptions`، ثم اضبط `target` على `"ES5"` و `module` على `"CommonJS"` (أو احذف خيار `module` تماماً).
9381

94-
The **second option** is to add settings for ts-node:
82+
**الحلّ الثاني**: أضِف إعدادات خاصة بـ ts-node.
9583

96-
You can keep `"module": "ESNext"` for `tsc`, and if you use webpack, or another build tool, set an override for ts-node. [ts-node config](https://typestrong.org/ts-node/docs/imports/)
84+
يمكنك إبقاء `"module": "ESNext"` لـ `tsc`، وإن كنت تستعمل webpack أو أداة بناء أخرى، فاضبط قيمة بديلة لـ ts-node. [توثيق إعداد ts-node](https://typestrong.org/ts-node/docs/imports/)
9785

9886
```json
9987
{
@@ -108,13 +96,13 @@ You can keep `"module": "ESNext"` for `tsc`, and if you use webpack, or another
10896
}
10997
```
11098

111-
The **third option** is to install the `tsconfig-paths` package:
99+
**الحلّ الثالث**: ثبّت حزمة `tsconfig-paths`:
112100

113101
```bash
114102
npm install --save-dev tsconfig-paths
115103
```
116104

117-
And create a separate TypeScript configuration specifically for your webpack configs:
105+
ثم أنشئ تخصيصاً مستقلاً لـ TypeScript مخصّصاً لملفات تخصيص webpack:
118106

119107
**tsconfig-for-webpack-config.json**
120108

@@ -128,9 +116,9 @@ And create a separate TypeScript configuration specifically for your webpack con
128116
}
129117
```
130118

131-
T> `ts-node` can resolve a `tsconfig.json` file using the environment variable provided by `tsconfig-paths`.
119+
T> يستطيع `ts-node` تحديد ملف `tsconfig.json` المطلوب عبر متغيّر البيئة الذي توفّره `tsconfig-paths`.
132120

133-
Then set the environment variable `process.env.TS_NODE_PROJECT` provided by `tsconfig-paths` like so:
121+
ثم اضبط متغيّر البيئة `process.env.TS_NODE_PROJECT` الذي توفّره `tsconfig-paths` على النحو التالي:
134122

135123
**package.json**
136124

@@ -142,17 +130,17 @@ Then set the environment variable `process.env.TS_NODE_PROJECT` provided by `tsc
142130
}
143131
```
144132

145-
W> We had been getting reports that `TS_NODE_PROJECT` might not work with `"TS_NODE_PROJECT" unrecognized command` error. Therefore running it with `cross-env` seems to fix the issue, for more info [see this issue](https://github.com/webpack/webpack.js.org/issues/2733).
133+
W> وردتنا بلاغات بأن `TS_NODE_PROJECT` قد لا يعمل أحياناً ويُظهر الخطأ `"TS_NODE_PROJECT" unrecognized command`. وقد ظهر أنّ تشغيله عبر `cross-env` يحلّ المشكلة. لمزيد من التفاصيل [راجع هذه القضية](https://github.com/webpack/webpack.js.org/issues/2733).
146134

147-
## CoffeeScript
135+
## كوفي سكريبت
148136

149-
Similarly, to use [CoffeeScript](https://coffeescript.org/), you would first install the necessary dependencies:
137+
بالطريقة نفسها، لاستخدام [CoffeeScript](https://coffeescript.org/)، ثبّت أوّلاً الاعتماديات اللازمة:
150138

151139
```bash
152140
npm install --save-dev coffeescript
153141
```
154142

155-
and then proceed to write your configuration:
143+
ثم اكتب التخصيص:
156144

157145
**webpack.config.coffee**
158146

@@ -185,13 +173,13 @@ config =
185173
export default config
186174
```
187175

188-
## Babel and JSX
176+
## Babel و JSX
189177

190-
In the example below JSX (React JavaScript Markup) and Babel are used, to create a JSON configuration that webpack can understand.
178+
في المثال أدناه، يُستخدم JSX (صياغة JavaScript الخاصة بـ React) مع Babel لإنشاء تخصيص بصيغة JSON يستطيع webpack فهمه.
191179

192-
> Courtesy of [Jason Miller](https://twitter.com/_developit)
180+
> بفضل من [Jason Miller](https://twitter.com/_developit)
193181
194-
First, install the necessary dependencies:
182+
ثبّت أوّلاً الاعتماديات اللازمة:
195183

196184
```bash
197185
npm install --save-dev babel-register jsxobj babel-preset-es2015
@@ -212,7 +200,7 @@ npm install --save-dev babel-register jsxobj babel-preset-es2015
212200
```jsx
213201
import jsxobj from "jsxobj";
214202

215-
// example of an imported plugin
203+
// مثال على plugin مستورد
216204
const CustomPlugin = (config) => ({
217205
...config,
218206
name: "custom-plugin",
@@ -236,4 +224,4 @@ export default (
236224
);
237225
```
238226

239-
W> If you are using Babel elsewhere and have `modules` set to `false`, you will have to either maintain two separate `.babelrc` files or use `const jsxobj = require('jsxobj');` and `module.exports` instead of the new `import` and `export` syntax. This is because while Node does support many new ES6 features, they don't yet support ES6 module syntax.
227+
W> إن كنت تستخدم Babel في أماكن أخرى وضبطت `modules` على `false`، فستضطر إمّا للاحتفاظ بملفَّي `.babelrc` منفصلين، أو استخدام `const jsxobj = require('jsxobj');` و `module.exports` بدلاً من صياغة `import` و `export` الجديدة. ذلك أنّ Node يدعم كثيراً من ميزات ES6 الجديدة، لكنه لا يدعم بعدُ صياغة وحدات ES6.

src/content/configuration/configuration-types.mdx

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,18 @@
11
---
2-
title: Configuration Types
2+
title: أنواع التخصيص
33
sort: 3
44
contributors:
5-
- sokra
6-
- skipjack
7-
- kbariotis
8-
- simon04
9-
- fadysamirsadek
10-
- byzyk
11-
- EugeneHlushko
12-
- dhurlburtusa
13-
- anshumanv
14-
- thorn0
15-
- tusharthakur04
5+
- RlxChap2
166
---
177

18-
Besides exporting a single configuration object, there are a few more ways that cover other needs as well.
8+
إلى جانب تصدير كائن تخصيص واحد، هناك طرق أخرى تغطّي احتياجات مختلفة.
199

20-
## Exporting a Function
10+
## تصدير دالّة
2111

22-
Eventually you will find the need to disambiguate in your `webpack.config.js` between [development](/guides/development) and [production builds](/guides/production). There are multiple ways to do that. One option is to export a function from your webpack configuration instead of exporting an object. The function will be invoked with two arguments:
12+
ستجد عاجلاً أم آجلاً حاجة إلى التمييز داخل `webpack.config.js` بين [بناء التطوير](/guides/development) و[بناء الإنتاج](/guides/production). وثمّة طرق متعددة لذلك. من بينها أن تُصدّر دالّة من ملف تخصيص webpack بدلاً من تصدير كائن. سيتمّ استدعاء هذه الدالّة بمعاملين:
2313

24-
- An environment as the first parameter. See the [environment options CLI documentation](/api/cli/#environment-options) for syntax examples.
25-
- An options map (`argv`) as the second parameter. This describes the options passed to webpack, with keys such as [`output-path`](/api/cli/#flags) and [`mode`](/api/cli/#flags).
14+
- بيئة (environment) بوصفها المعامل الأول. راجع [توثيق خيارات البيئة في الـ CLI](/api/cli/#environment-options) لأمثلة على الصياغة.
15+
- خريطة خيارات (`argv`) بوصفها المعامل الثاني. تصف هذه الخريطة الخيارات الممرَّرة إلى webpack، بمفاتيح مثل [`output-path`](/api/cli/#flags) و[`mode`](/api/cli/#flags).
2616

2717
```diff
2818
-export default {
@@ -33,19 +23,19 @@ Eventually you will find the need to disambiguate in your `webpack.config.js` be
3323
plugins: [
3424
new MinimizerPlugin({
3525
minimizerOptions: {
36-
+ compress: argv.mode === 'production' // only if `--mode production` was passed
26+
+ compress: argv.mode === 'production' // فقط في حال تمرير `--mode production`
3727
}
3828
})
3929
]
4030
+ };
4131
};
4232
```
4333

44-
## Exporting a Promise
34+
## تصدير Promise
4535

46-
Webpack will run the function exported by the configuration file and wait for a Promise to be returned. Handy when you need to asynchronously load configuration variables.
36+
سيُشغّل webpack الدالّة المُصدَّرة من ملف التخصيص، وينتظر منها إرجاع Promise. وهذا مفيد حين تحتاج إلى تحميل متغيّرات التخصيص بشكل غير متزامن.
4737

48-
T> It is possible to export multiple promises by wrapping them into `Promise.all([/* Your promises */]).`
38+
T> يمكنك تصدير عدّة Promises عبر تغليفها داخل `Promise.all([/* Promises الخاصة بك */])`.
4939

5040
```js
5141
export default () =>
@@ -59,11 +49,11 @@ export default () =>
5949
});
6050
```
6151

62-
W> Returning a `Promise` only works when using webpack via CLI. [`webpack()`](/api/node/#webpack) expects an object.
52+
W> إرجاع `Promise` يعمل فقط حين تستخدم webpack عبر الـ CLI. أمّا [`webpack()`](/api/node/#webpack) فيتوقّع كائناً.
6353

64-
## Exporting multiple configurations
54+
## تصدير تخصيصات متعددة
6555

66-
Instead of exporting a single configuration object/function, you may export multiple configurations (multiple functions are supported since webpack 3.1.0). When running webpack, all configurations are built. For instance, this is useful for [bundling a library](/guides/author-libraries) for multiple [targets](/configuration/output/#outputlibrarytarget) such as AMD and CommonJS:
56+
عوضاً عن تصدير كائن أو دالّة تخصيص واحدة، يمكنك تصدير عدّة تخصيصات (وقد دُعمت الدوال المتعددة منذ webpack 3.1.0). وعند تشغيل webpack، تُبنى كل التخصيصات معاً. وهذا مفيد مثلاً عند [حزم مكتبة](/guides/author-libraries) لعدّة [أهداف (targets)](/configuration/output/#outputlibrarytarget) كـ AMD و CommonJS:
6757

6858
```js
6959
export default [
@@ -88,11 +78,11 @@ export default [
8878
];
8979
```
9080

91-
T> If you pass a name to [`--config-name`](/api/cli/#config-name) flag, webpack will only build that specific configuration.
81+
T> لو مرّرت اسماً إلى الراية [`--config-name`](/api/cli/#config-name)، فلن يبني webpack إلا التخصيص المطابق لذلك الاسم فقط.
9282

9383
### dependencies
9484

95-
In case you have a configuration that depends on the output of another configuration, you can specify a list of dependencies using the [`dependencies`](/configuration/other-options/#dependencies) array.
85+
إن كان لديك تخصيص يعتمد على ناتج تخصيص آخر، فيمكنك تحديد قائمة بالاعتماديات عبر مصفوفة [`dependencies`](/configuration/other-options/#dependencies).
9686

9787
**webpack.config.js**
9888

@@ -111,26 +101,24 @@ export default [
111101
];
112102
```
113103

114-
### parallelism
104+
### التوازي
115105

116-
In case you export multiple configurations, you can use the `parallelism` option on the configuration array to specify the maximum number of compilers that will compile in parallel.
106+
عند تصدير تخصيصات متعددة، يمكنك استخدام الخيار `parallelism` على مصفوفة التخصيصات لتحديد الحدّ الأقصى لعدد الـ compilers التي ستعمل بالتوازي.
117107

118-
- Type: `number`
119-
- Available: 5.22.0+
108+
- النوع: `number`
109+
- متاح: 5.22.0+
120110

121111
**webpack.config.js**
122112

123113
```js
124114
const config = [
125115
{
126-
// config-1
116+
// التخصيص-1
127117
},
128118
{
129-
// config-2
119+
// التخصيص-2
130120
},
131121
];
132-
133122
config.parallelism = 1;
134-
135123
export default config;
136124
```

0 commit comments

Comments
 (0)