vue.jsvuejs2transpiler

How is Vue.js and Vue.min.JS compiled?


I'm am trying to understand the directives that produce the output /dist/vue[.min].js file(s). While looking in node_modules folder, I see /dist and /src folders. The /src folder contains index.js. If I were to follow the dependency tree all the way through, would that result in the dist file? If the compiler is present, or the rules, in the vue package. I would appreciate if someone could point this out (and also verify/debunk my understanding of how the output file is produced).


Solution

  • Your build tool is actually responsible for creating the vue.min.js file. In case if you are not using any build tool then you need to use the minified version of vue.js file from the Vuejs site.

    Also the vue.js gets created using the mode value of process.env.NODE_ENV variable.

    You can have more details of this from the Production Deployment docs from the Vuejs site.

    The rest of the details regarding the dir structure given in the vue.config.js config file.