You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/v2/guide/deployment.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,34 +1,34 @@
1
1
---
2
-
title: Production Deployment
2
+
title: نشر الإنتاج
3
3
type: guide
4
4
order: 404
5
5
---
6
6
7
-
> Most of the tips below are enabled by default if you are using [Vue CLI](https://cli.vuejs.org). This section is only relevant if you are using a custom build setup.
7
+
> يتم تمكين معظم النصائح أدناه افتراضيًا إذا كنت تستخدم [Vue CLI](https://cli.vuejs.org). هذا القسم مناسب فقط إذا كنت تستخدم إعداد بناء مخصص.
8
8
9
-
## Turn on Production Mode
9
+
## تشغيل وضع الإنتاج
10
10
11
-
During development, Vue provides a lot of warnings to help you with common errors and pitfalls. However, these warning strings become useless in production and bloat your app's payload size. In addition, some of these warning checks have small runtime costs that can be avoided in production mode.
11
+
أثناء التطوير، تقدم Vue الكثير من التحذيرات لمساعدتك في الأخطاء والمخاطر الشائعة. ومع ذلك، فإن سلاسل التحذير هذه تصبح غير مجدية في الإنتاج وتُضَخم حجم حمولة التطبيق. بالإضافة إلى ذلك، تحتوي بعض عمليات التحقق من التحذيرات هذه على تكاليف وقت تشغيل صغيرة يمكن تجنبها في وضع الإنتاج.
12
12
13
-
### Without Build Tools
13
+
### دون أدوات البناء
14
14
15
-
If you are using the full build, i.e. directly including Vue via a script tag without a build tool, make sure to use the minified version (`vue.min.js`) for production. Both versions can be found in the [Installation guide](installation.html#Direct-lt-script-gt-Include).
15
+
إذا كنت تستخدم البنية الكاملة، أي تضمين Vue مباشرة عبر علامة البرنامج النصي بدون أداة إنشاء، تأكد من استخدام الإصدار المصغر (`vue.min.js`) للإنتاج. يمكن العثور على كلا الإصدارين في [دليل التثبيت](installation.html#Direct-lt-script-gt-Include).
16
16
17
-
### With Build Tools
17
+
### مع أدوات البناء
18
18
19
-
When using a build tool like Webpack or Browserify, the production mode will be determined by `process.env.NODE_ENV`inside Vue's source code, and it will be in development mode by default. Both build tools provide ways to overwrite this variable to enable Vue's production mode, and warnings will be stripped by minifiers during the build. All `vue-cli`templates have these pre-configured for you, but it would be beneficial to know how it is done:
19
+
عند استخدام أداة إنشاء مثل Webpack أو Browserify، سيتم تحديد وضع الإنتاج بواسطة `process.env.NODE_ENV`داخل شفرة مصدر Vue، وسيكون في وضع التطوير افتراضيًا. توفر كلتا أدوات التصميم طرقًا للاستبدال هذا المتغير لتمكين وضع الإنتاج الخاص بـ Vue، وسيتم تجريد التحذيرات بواسطة المصغرات أثناء الإنشاء. تحتوي جميع قوالب `vue-cli`على هذه التكوينات المسبقة لك، لكن سيكون من المفيد معرفة كيفية القيام بذلك:
20
20
21
21
#### Webpack
22
22
23
-
In Webpack 4+, you can use the `mode` option:
23
+
في Webpack 4+، يمكنك استخدام خيار `mode`:
24
24
25
25
```js
26
26
module.exports= {
27
27
mode:'production'
28
28
}
29
29
```
30
30
31
-
But in Webpack 3 and earlier, you'll need to use[DefinePlugin](https://webpack.js.org/plugins/define-plugin/):
31
+
ولكن في Webpack 3 والإصدارات السابقة، ستحتاج إلى استخدام[DefinePlugin](https://webpack.js.org/plugins/define-plugin/):
32
32
33
33
```js
34
34
var webpack =require('webpack')
@@ -46,15 +46,15 @@ module.exports = {
46
46
47
47
#### Browserify
48
48
49
-
-Run your bundling command with the actual`NODE_ENV`environment variable set to `"production"`. This tells`vueify`to avoid including hot-reload and development related code.
49
+
-قم بتشغيل أمر التجميع باستخدام متغير البيئة`NODE_ENV`الفعلي الذي تم تعيينه على "الإنتاج". هذا يخبر`vueify`لتجنب إعادة التحميل الساخنة وشفرة التطوير ذات الصلة.
50
50
51
-
-Apply a global[envify](https://github.com/hughsk/envify)transform to your bundle. This allows the minifier to strip out all the warnings in Vue's source code wrapped in env variable conditional blocks. For example:
51
+
-قم بتطبيق تحويل[envify](https://github.com/hughsk/envify)إلى الحزمة الخاصة بك. يسمح هذا لجهاز المصغر بتجميع كافة التحذيرات في شفرة مصدر Vue ملفوفة في كتل شرطية متغير env. فمثلا:
When using in-DOM templates or in-JavaScript template strings, the template-to-render-function compilation is performed on the fly. This is usually fast enough in most cases, but is best avoided if your application is performance-sensitive.
115
+
عند استخدام القوالب داخل DOM أو سلاسل قوالب JavaScript، يتم تنفيذ التصيير من القالب إلى function أثناء التنقل. عادة ما يكون هذا سريعًا في معظم الحالات، ولكن من الأفضل تجنبه إذا كان التطبيق الخاص بك حساسًا للأداء.
116
116
117
-
The easiest way to pre-compile templates is using[Single-File Components](single-file-components.html) - the associated build setups automatically performs pre-compilation for you, so the built code contains the already compiled render functions instead of raw template strings.
117
+
إن أسهل طريقة لإعداد القوالب المسبقة هي استخدام[Single-File Components](single-file-components.html) - تقوم إعدادات الإنشاء المرتبطة تلقائيًا بإجراء التحويل المسبق نيابة عنك، وبالتالي فإن الشفرة المدمجة تحتوي على وظائف التصيير المترجمة بالفعل بدلاً من سلاسل قالب الخام.
118
118
119
-
If you are using Webpack, and prefer separating JavaScript and template files, you can use [vue-template-loader](https://github.com/ktsn/vue-template-loader), which also transforms the template files into JavaScript render functions during the build step.
119
+
إذا كنت تستخدم Webpack، وتفضل فصل ملفات JavaScript والقالب، فيمكنك استخدام [vue-template-loader](https://github.com/ktsn/vue-template-loader)، والذي يحول أيضًا ملفات القوالب إلى JavaScript تقديم وظائف خلال خطوة البناء.
120
120
121
-
## Extracting Component CSS
121
+
## استخراج مكون CSS
122
122
123
-
When using Single-File Components, the CSS inside components are injected dynamically as `<style>`tags via JavaScript. This has a small runtime cost, and if you are using server-side rendering it will cause a "flash of unstyled content". Extracting the CSS across all components into the same file will avoid these issues, and also result in better CSS minification and caching.
123
+
عند استخدام مكونات أحادية الملف، يتم حقن المكونات الداخلية لـ CSS ديناميكيًا كعلامات `<style>`عبر JavaScript. هذا له تكلفة تشغيل صغيرة، وإذا كنت تستخدم التجسيد من جانب الخادم، فسيؤدي ذلك إلى "flash لمحتوى غير منسق". سيتسبب استخراج CSS عبر جميع المكونات في نفس الملف في تجنب هذه المشكلات، كما يؤدي إلى تحسين CSS وتخزينها مؤقتًا.
124
124
125
-
Refer to the respective build tool documentations to see how it's done:
125
+
ارجع إلى وثائق أداة الإنشاء المعنية لترى كيف يتم ذلك:
126
126
127
127
-[Webpack + vue-loader](https://vue-loader.vuejs.org/en/configurations/extract-css.html) (the `vue-cli` webpack template has this pre-configured)
If a runtime error occurs during a component's render, it will be passed to the global `Vue.config.errorHandler`config function if it has been set. It might be a good idea to leverage this hook together with an error-tracking service like [Sentry](https://sentry.io), which provides [an official integration](https://sentry.io/for/vue/)for Vue.
133
+
إذا حدث خطأ في وقت التشغيل أثناء تصيير أحد المكونات، فسيتم تمريره إلى وظيفة التكوين `Vue.config.errorHandler`العالمية إذا تم تعيينها. قد تكون فكرة جيدة الاستفادة من هذا الخطاف مع خدمة تتبع الأخطاء مثل [Sentry](https://sentry.io) ، والتي توفر [تكاملًا رسميًا](https://sentry.io/for/vue/)ل Vue.
0 commit comments