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
If you are using native ES Modules, there is also an ES Modules compatible build:
49
+
Jika kamu menggunakan ES Module asli, disediakan juga bundel kompatibel dengan ES Modules:
50
50
51
51
```html
52
52
<scripttype="module">
@@ -96,37 +96,39 @@ Di dalam [direktori `dist/` dari paket NPM](https://cdn.jsdelivr.net/npm/vue/dis
96
96
97
97
-**Runtime**: kode yang bertanggung jawab untuk membuat instan Vue, _rendering_, dan _patching_ DOM virtual, dll. Pada dasarnya semua kecuali _compiler_.
98
98
99
-
-**[UMD](https://github.com/umdjs/umd)**: UMD builds can be used directly in the browser via a`<script>` tag. The default file from jsDelivr CDN at[https://cdn.jsdelivr.net/npm/vue](https://cdn.jsdelivr.net/npm/vue)is the Runtime + Compiler UMD build (`vue.js`).
99
+
-**[UMD](https://github.com/umdjs/umd)**: Bundel UMD dapat digunakan langsung pada browser dengan *tag*`<script>`. file standart dari jsDelivr CDN [https://cdn.jsdelivr.net/npm/vue](https://cdn.jsdelivr.net/npm/vue)merupakan *Runtime* + *Compiler* bundel UMD (`vue.js`).
100
100
101
-
-**[CommonJS](http://wiki.commonjs.org/wiki/Modules/1.1)**: CommonJS builds are intended for use with older bundlers like [browserify](http://browserify.org/)or[webpack 1](https://webpack.github.io). The default file for these bundlers (`pkg.main`) is the Runtime only CommonJS build (`vue.runtime.common.js`).
101
+
-**[CommonJS](http://wiki.commonjs.org/wiki/Modules/1.1)**: Bundel CommonJS ditargetkan untuk digunakan oleh *bundler* lama seperti [browserify](http://browserify.org/)atau[webpack 1](https://webpack.github.io). Standar pada *bundler* ini (`pkg.main`) merupakan *Runtime only CommonJS* bundel (`vue.runtime.common.js`).
102
102
103
-
-**[ES Module](http://exploringjs.com/es6/ch_modules.html)**: starting in 2.6 Vue provides two ES Modules (ESM) builds:
103
+
-**[ES Module](http://exploringjs.com/es6/ch_modules.html)**: mulai pada 2.6 Vue menyediakan dua bundel ES Modules (ESM):
104
104
105
-
- ESM for bundlers: intended for use with modern bundlers like [webpack 2](https://webpack.js.org)or[Rollup](https://rollupjs.org/). ESM format is designed to be statically analyzable so the bundlers can take advantage of that to perform "tree-shaking" and eliminate unused code from your final bundle. The default file for these bundlers (`pkg.module`) is the Runtime only ES Module build (`vue.runtime.esm.js`).
105
+
- ESM untuk *bundlers*: dimaksudkan untuk digunakan dengan *bundler*modern seperti [webpack 2](https://webpack.js.org)atau[Rollup](https://rollupjs.org/). Format ESM didesain secara statis dan dapat di analisis, sehingga *bundler* dapat mengambil keuntungan dari hal tersebut untuk melakukan [*tree-shaking*](https://www.keycdn.com/blog/tree-shaking) dan meng-eliminasi kode yang tidak digunakan dari bundel finalmu. File standar untuk bundel ini (`pkg.module`) adalah *Runtime only ES Module* bundel (`vue.runtime.esm.js`).
106
106
107
-
- ESM for browsers (2.6+ only): intended for direct imports in modern browsers via`<script type="module">`.
107
+
- ESM untuk browser (2.6+ only): dimaksudkan untuk impor modul langsung di browser modern `<script type="module">`.
108
108
109
109
### Runtime + Compiler vs. Runtime-only
110
110
111
111
If you need to compile templates on the client (e.g. passing a string to the `template` option, or mounting to an element using its in-DOM HTML as the template), you will need the compiler and thus the full build:
112
112
113
+
Jika kamu membutuhkan untuk menyusun (*compile*) templat pada sisi klien (contoh: menggunakan *string* pada opsi `template`, atau memasang pada element menggukana *in-DOM HTML* sebagai templat), kamu membutuhkan penyusun (*compiler*) dan dengan demikian juga bundel penuh (*full-build*).
114
+
113
115
```js
114
-
//this requires the compiler
116
+
//Ini membutuhkan kompiler
115
117
newVue({
116
118
template:'<div>{{ hi }}</div>'
117
119
})
118
120
119
-
//this does not
121
+
//ini tidak
120
122
newVue({
121
123
render (h) {
122
124
returnh('div', this.hi)
123
125
}
124
126
})
125
127
```
126
128
127
-
When using `vue-loader`or`vueify`, templates inside `*.vue`files are pre-compiled into JavaScript at build time. You don't really need the compiler in the final bundle, and can therefore use the runtime-only build.
129
+
Saat kamu menggunakan `vue-loader`atau`vueify`, templat di dalam `*.vue`file sudah dikompilasi ke bentuk JavaScript pada saat built time. Kamu tidak terlalu membutuhkan kompiler dalam bundel akhir, dan hanya menggunakan *runtime-only* bundel.
128
130
129
-
Since the runtime-only builds are roughly 30% lighter-weight than their full-build counterparts, you should use it whenever you can. If you still wish to use the fullbuild instead, you need to configure an alias in your bundler:
131
+
Dikarenakan bundel *runtime-only*30% lebih ringan daripada cara lain `full-build`, kamu harus menggunakannya disaat kamu bisa. Tapi jika kamu ingin menggunakan `full-build`, dapat dilakukan dengan menambahkan alias pada bundler.
130
132
131
133
#### Webpack
132
134
@@ -135,7 +137,7 @@ module.exports = {
135
137
// ...
136
138
resolve: {
137
139
alias: {
138
-
'vue$':'vue/dist/vue.esm.js'// 'vue/dist/vue.common.js' for webpack 1
140
+
'vue$':'vue/dist/vue.esm.js'// 'vue/dist/vue.common.js' untuk webpack versi 1
139
141
}
140
142
}
141
143
}
@@ -158,7 +160,7 @@ rollup({
158
160
159
161
#### Browserify
160
162
161
-
Add to your project's `package.json`:
163
+
Tambahkan pada `package.json` anda:
162
164
163
165
```js
164
166
{
@@ -171,7 +173,7 @@ Add to your project's `package.json`:
171
173
172
174
#### Parcel
173
175
174
-
Add to your project's `package.json`:
176
+
Tambahkan pada `package.json` anda:
175
177
176
178
```js
177
179
{
@@ -182,25 +184,24 @@ Add to your project's `package.json`:
182
184
}
183
185
```
184
186
185
-
### Development vs. Production Mode
187
+
### Masa Pengembangan vs. Masa Produksi (*Development vs. Production Mode*)
186
188
187
-
Development/production modes are hard-coded for the UMD builds: the un-minified files are for development, and the minified files are for production.
189
+
Masa pengembangan/produksi merupakan hasil `hard-coded` bundel UMD: bundel yang tidak di minifikasi merupakan bundel masa pengembangan dan yang tidak di minifikasi merupakan bundel masa produksi.
188
190
189
-
CommonJS and ES Module builds are intended for bundlers, therefore we don't provide minified versions for them. You will be responsible for minifying the final bundle yourself.
191
+
Bundel CommonJS dan ES Module dimaksudkan kepada pembuat bundel (*bundlers*), karena itu kita tidak menyediakan versi minifikasi untuk bundel tersebut (CommonJs dan ES Module). Kamu bertanggunag jawab atas bundel akhir untuk strategi minifikasi tersebut.
190
192
191
-
CommonJS and ES Module builds also preserve raw checks for `process.env.NODE_ENV`to determine the mode they should run in. You should use appropriate bundler configurations to replace these environment variables in order to control which mode Vue will run in. Replacing`process.env.NODE_ENV`with string literals also allows minifiers like UglifyJS to completely drop the development-only code blocks, reducing final file size.
193
+
Bundel CommonJS dan ES Module juga mempertahankan untuk memeriksa mentah `process.env.NODE_ENV`untuk menentukan mode mana yang digunakan saat apliaksi berjalan. Kamu harus menggunakan konfigurasi pembuat bundel (*bundler*) yang benar untuk menggantikan variabel ekosistem tersebut dikarekan untuk mengontrol di mode manakah Vue harus berjalan (Masa pengembangan/produksi). Mengganti`process.env.NODE_ENV`menggunakan *string literal* juga memungkinkan alat minifikasi (*minifiers*) seperti UglifyJS untuk membuang blok code pada masa pengembangan.
192
194
193
195
#### Webpack
194
196
195
-
In Webpack 4+, you can use the`mode` option:
197
+
Di dalam Webpack 4+, kamu dapat menggunakan opsi`mode`:
196
198
197
199
```js
198
200
module.exports= {
199
201
mode:'production'
200
202
}
201
203
```
202
-
203
-
But in Webpack 3 and earlier, you'll need to use [DefinePlugin](https://webpack.js.org/plugins/define-plugin/):
204
+
Untuk Webpack 3 dan sebelumnya, kamu harus menggunakan [*DefinePlugin*](https://webpack.js.org/plugins/define-plugin/):
204
205
205
206
```js
206
207
var webpack =require('webpack')
@@ -220,7 +221,7 @@ module.exports = {
220
221
221
222
#### Rollup
222
223
223
-
Use [rollup-plugin-replace](https://github.com/rollup/rollup-plugin-replace):
Also see [Production Deployment Tips](deployment.html).
247
+
Lihat juga [tips masa produksi dan pengembangan](deployment.html).
248
+
249
+
### Ekosistem CSP
247
250
248
-
### CSP environments
251
+
Beberapa lingkungan, seperti Google Chrome Apps, mengharuskan Content Security Policy (CSP), dimana melarang penggunakan `new Function()` untuk mengevaluasi ekspresi (dalam hal ini *function expression*). Bundel akhir tergantung pada fitur ini untuk menyusun templat, jadi *bundler* tidak berguna sama sekali dalam ekosistem ini.
249
252
250
-
Some environments, such as Google Chrome Apps, enforce Content Security Policy (CSP), which prohibits the use of `new Function()` for evaluating expressions. The full build depends on this feature to compile templates, so is unusable in these environments.
253
+
Di sisi lain, *runtime-only* bundel merupakan bundel yang sesui untuk ekositem CSP. Saat menggunakan bundel *runtime-only* dengan [Webpack + Vueloader](https://github.com/vuejs-templates/webpack-simple) atau [Browserify + vueify](https://github.com/vuejs-templates/browserify-simple) tempatmu akan disusun kedalam fungsi `render` yang dimana hal ini cocok untuk ekosistem CSP
251
254
252
-
On the other hand, the runtime-only build is fully CSP-compliant. When using the runtime-only build with [Webpack + vue-loader](https://github.com/vuejs-templates/webpack-simple) or [Browserify + vueify](https://github.com/vuejs-templates/browserify-simple), your templates will be precompiled into `render` functions which work perfectly in CSP environments.
255
+
## Bundel Pengembangan (*Dev Build*)
253
256
254
-
## Dev Build
257
+
**Penting**: the built files in GitHub's `/dist` folder are only checked-in during releases. To use Vue from the latest source code on GitHub, you will have to build it yourself!
255
258
256
-
**Important**: the built files in GitHub's `/dist` folder are only checked-in during releases. To use Vue from the latest source code on GitHub, you will have to build it yourself!
259
+
File bundel pada Github `/dist` folder hanya disusun (*compile*) saat rilis. Untuk menggunakan Vue dari kode sumber terakhir di Github, kamu harus menyusun-nya sendiri.
0 commit comments