Recently in the study of VUe2.0 source code, a colleague asked how to debug vue2.0 source code, so based on the teaching document of Yang Village head simple description. 😂

To obtain the vue

Clone from Github

Git clone github.com/vuejs/vue.g…

Debugging Environment Setup

  1. Install dependency: NPM install terminates by installing phantom

  2. In package.json file, modify the dev script

    "Dev ": "rollup -w -c scripts/config.js --sourcemap --environment TARGET:web-full-dev" Adds sourcemapCopy the code
  3. npm run dev

  4. In your test file

    <script src=".. /.. /dist/vue.js"></script>Copy the code

Start debugging

Open the test file in a browser, F12

This allows you to debug in the browser