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
Every application reaches a point where it's necessary to understand failures, small to large. In this recipe, we explore a few workflows for VS Code users who would like to debug their application in the browser.
7
+
Setiap aplikasi akan mencapai titik di mana perlu untuk memahami galat, kecil atau besar. Di resep ini, kita mengeksplorasi beberapa alur kerja untuk pengguna VS Code yang ingin men-debug aplikasinya di browser.
8
8
9
-
This recipe shows how to to debug [Vue CLI](https://github.com/vuejs/vue-cli)applications in VS Code as they run in the browser.
9
+
Resep ini menunjukkan cara untuk men-debug aplikasi [Vue CLI](https://github.com/vuejs/vue-cli)di VS Code saat dijalankan di browser.
10
10
11
-
<pclass="tip">Note: This recipe covers Chrome and Firefox. If you know how to setup VS Code debugging with other browsers, please consider sharing your insights (see bottom of the page).</p>
11
+
<pclass="tip">Catatan: Resep ini mencakup peramban Chrome dan Firefox. Jika anda tahu cara mengatur <i>debugger</i> VS Code untuk bekerja diperamban lain, silahkan pertimbangkan untuk berbagi (lihat bagian bawah halaman)</p>
12
12
13
-
## Prerequisites
13
+
## Prasyarat
14
14
15
-
Make sure you have VS Code and the browser of your choice installed, and the latest version of the corresponding Debugger extension installed and enabled:
15
+
Pastikan anda sudah menginstal VS Code dan peramban pilihan anda, juga ekstensi _debugger_-nya sudah dipasang dan diaktifkan.
16
16
17
-
*[Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome)
18
-
*[Debugger for Firefox](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-firefox-debug)
17
+
-[_Debugger_ untuk Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome)
18
+
-[_Debugger_ untuk Firefox](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-firefox-debug)
19
19
20
-
Install and create a project with the [vue-cli](https://github.com/vuejs/vue-cli), following the instructions in the [Vue CLI Guide](https://cli.vuejs.org/). Change into the newly created application directory and open VS Code.
20
+
Pasang dan buat proyek dengan [vue-cli](https://github.com/vuejs/vue-cli), ikut instruksi [Panduan Vue CLI](https://cli.vuejs.org/). Lalu masuk ke folder proyek yang baru dibuat dan buka di VS Code.
21
21
22
-
### Displaying Source Code in the Browser
22
+
### Menampilkan kode di Browser
23
23
24
-
Before you can debug your Vue components from VS Code, you need to update the generated Webpack config to build sourcemaps. We do this so that our debugger has a way to map the code within a compressed file back to its position in the original file. This ensures that you can debug an application even after your assets have been optimized by Webpack.
24
+
Sebelum anda bisa mendebug komponen Vue dari VS Code, anda harus memperbarui konfigurasi Webpack yang barusan dibuat untuk membangun `sourcemaps`. Kita melakukan ini agar _debugger_ yang dipakai bisa memetakan kode didalam berkas yang terkompresi kembali ke berkas aslinya. Ini memastikan bahwa anda dapat men-debug aplikasi bahkan setelah aset atau kode anda sudah di optimisasi oleh Webpack.
25
25
26
-
If you use Vue CLI 2, set or update the`devtool`property inside`config/index.js`:
26
+
Jika anda menggunakan Vue CLI 2, atur atau ubah properti`devtool`didalam berkas`config/index.js`:
27
27
28
28
```json
29
29
devtool: 'source-map',
30
30
```
31
31
32
-
If you use Vue CLI 3, set or update the`devtool`property inside`vue.config.js`:
32
+
Jika anda menggunakan Vue CLI 3, atur atau ubah properti`devtool`didalam berkas`vue.config.js`:
33
33
34
34
```js
35
35
module.exports= {
@@ -39,11 +39,13 @@ module.exports = {
39
39
}
40
40
```
41
41
42
-
### Launching the Application from VS Code
42
+
### Menjalankan aplikasi dari VS Code
43
43
44
44
Click on the Debugging icon in the Activity Bar to bring up the Debug view, then click on the gear icon to configure a launch.json file, selecting **Chrome/Firefox: Launch** as the environment. Replace content of the generated launch.json with the corresponding configuration:
Klik ikon _debugging_ di _Activity Bar_ VS Code untuk memunculkan tampilan Debug, lalu klik pada ikon roda gigi untuk mengonfigurasi berkas `launch.json`, pilih **Chrome/Firefox: _Launch_**
2.Open your favorite terminal at the root folder and serve the app using Vue CLI:
83
+
2.Buka konsol favorit anda di folder utama aplikasi dan sajikan aplikasi menggunakan Vue CLI:
82
84
83
-
```
84
-
npm start
85
-
```
85
+
```
86
+
npm start
87
+
```
86
88
87
-
3.Go to the Debug view, select the**'vuejs: chrome/firefox'** configuration, then press F5 or click the green play button.
89
+
3.Buka tampilan Debug, pilih konfigurasi**'vuejs: chrome/firefox'**, lalu tekan F5 atau klik tombol mainkan yang berwarna hijau.
88
90
89
-
4.Your breakpoint should now be hit as a new browser instance opens`http://localhost:8080`.
91
+
4._Breakpoint_ anda akan terkena ketika peramban anda membuka`http://localhost:8080`.
90
92
91
-

93
+

92
94
93
-
## Alternative Patterns
95
+
## Pola Alternatif
94
96
95
-
### Vue Devtools
97
+
### Menggunakan alat pengembang Vue
96
98
97
-
There are other methods of debugging, varying in complexity. The most popular and simple of which is to use the excellent Vue.js devtools [for Chrome](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd)and [for Firefox](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/). Some of the benefits of working with the devtools are that they enable you to live-edit data properties and see the changes reflected immediately. The other major benefit is the ability to do time travel debugging for Vuex.
99
+
Ada cara lain untuk men-debug, kompleksitasnya beragam. Yang paling populer dan mudah adalah menggunakan alat pengembang Vue.js (_Vue.js Devtools_) yang bekerja sangat baik, silahkan pasang di peramban pilihan anda: [Chrome](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd)atau [Firefox](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/). Beberapa manfaat bekerja dengan alat pengembang adalah memungkinkan anda untuk menyunting langsung properti data dan melihat perubahan yang secara otomatis langsung ditampilkan. Manfaat lain adalah memungkinkan anda untuk melakukan _Time travel debugging_ untuk Vuex.

100
102
101
-
<pclass="tip">Please note that if the page uses a production/minified build of Vue.js (such as the standard link from a CDN), devtools inspection is disabled by default so the Vue pane won't show up. If you switch to an unminified version, you may have to give the page a hard refresh to see them.</p>
103
+
<pclass="tip">Harap perhatikan bahwa jika halaman menggunakan paket Vue.js yang disusun untuk dijalankan pada aplikasi produksi atau yang sudah di perkecil (seperti menggunakan tautan dari CDN), inspeksi alat pengembang dinonaktifkan secara standar sehingga panel alat pengembang Vue.js tidak akan muncul. Jika anda beralih ke versi yang tidak diperkecil, anda mungkin harus memuat ulang halaman dengan keras, pada peramban Chrome/Firefox, bisa dengan menekan CTRL/CMD+SHIFT+R.</p>
102
104
103
-
### Simple Debugger Statement
105
+
### Kode _Debugger_ Sederhana
104
106
105
-
The example above has a great workflow. However, there is an alternative option where you can use the [native debugger statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger)directly in your code. If you choose to work this way, it's important that you remember to remove the statements when you're done.
107
+
Contoh diatas memiliki alur kerja yang bagus. Namun, ada opsi alternatif di mana anda dapat menggunakan [kode _debugger_ bawaan](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger)secara langsung. Jika anda memilih untuk bekerja menggunakan cara ini, sangat penting untuk mengingat untuk menghapus kode _debugger_ bawaannya saat anda sudah selesai.
106
108
107
109
```js
108
110
<script>
@@ -121,6 +123,6 @@ export default {
121
123
</script>
122
124
```
123
125
124
-
## Acknowledgements
126
+
## Ucapan Terima Kasih
125
127
126
-
This recipe was based on a contribution from [Kenneth Auchenberg](https://twitter.com/auchenberg), [available here](https://github.com/Microsoft/VSCode-recipes/tree/master/vuejs-cli).
128
+
Resep ini berdasar pada kontribusi dari [Kenneth Auchenberg](https://twitter.com/auchenberg), [tersedia disini](https://github.com/Microsoft/VSCode-recipes/tree/master/vuejs-cli).
0 commit comments