Read the source code for the first time, do not know whether to insist on reading. Anyway, take notes while you’re in the mood. If there are mistakes in the article, you are welcome to correct the officer, not very grateful.
In writing this article, see a big video explanation, video is very detailed, address: www.bilibili.com/s/video/BV1…
Download the code
Clone the code and run it locally.
https://github.com/vuejs/vue-next
Copy the code
Install dependencies
Yarn 1.x is required to install the dependency, so I reinstalled the dependency
yarn
Copy the code
Check the package. The json
NPM run dev = NPM run dev = NPM run dev = NPM run dev = NPM run dev Open scripts/dev.js and see what’s in it. Dev.js has very little code in it and uses sourcemap mainly for source code debugging.Then add –sourcemap to the command to turn on sourcemapAfter the command, you can see generates packages/vue/dist/vue. Global. Js file, and the corresponding sourcemap fileIn package.json scripts, there is also a serve command, NPM run serve
I’m going to go to any one of these okay, todomvc.html, break point, and I’m going to start with createApp See the directory structure on the left, you can also go to the corresponding code directory to read directly
All right, the environment is ready for fun, everybody, let’s go!