Complete Vue.js 2 Web Development_ Practical guide to building end-to-end web development solutions with Vue.js 2

(singke) #1
Organize + Automate + Deploy = Webpack Chapter 16

Getting ready


This recipe is directed at those who want to share their work in Vue with the rest of the
community. In the Bundling your component with Webpack recipe, you will find how to tweak


the official Webpack template to bundle your component correctly; this recipe can be
thought of as a second part. We will not use the official template though.


How to do it...


The approach I will take for this recipe is to use the excellent vue-share-components


template by Guillaume Chau. We'll build a joke button from that starting point.


In your command line, create a new directory and type the following command inside it:


vue init Akryum/vue-share-components

It will ask you some questions; you can copy the responses from the following image. The
only thing to note is that you (sadly) cannot use the joke-button name for your project


because I have already registered it while writing this recipe. However, you can come up
with a similar sounding name (you may want to check whether the name is available in the


npm registry before moving ahead):

Free download pdf