Vue Share Components

screenshot of Vue Share Components

Vue Share Components

vue-cli template to publish components easily

Overview

This article introduces an easy-to-use vue-cli template for publishing Vue components. It also provides instructions on how to install the template and use it for plugin development. The template comes pre-configured with webpack 2.0 and supports import and browser installation. It also supports popular CSS preprocessors like Less, Sass/Scss, and Stylus. The article includes a guide on how to watch and compile the components, how to use the template in another project, and how to publish the plugin to npm.

Features

  • Vue-cli template: An easy-to-use template for publishing Vue components.
  • Webpack 2.0 pre-configured: The template comes pre-configured with webpack 2.0 for easy development.
  • Supports Import and Browser installation: The template supports both import and browser installation for the plugin with distribution-ready files.
  • Supports Less, Sass/Scss, and Stylus: The template supports popular CSS preprocessors for styling the components.
  • Easy development with auto-compilation: The template provides auto-compilation of the components during development.
  • Publishing to npm: The template provides instructions on how to publish the plugin to npm.
  • Watch and compile: Instructions on how to watch and compile the components using webpack.
  • Usage in another project: Instructions on how to use the template in another project.

Installation

To install the template, you need to first install the default dependencies. Run the following command in your plugin folder:

npm install

To watch and compile the components, run the following command:

npm run watch

To use the template in another project, follow the install instructions of your plugin and then link it into the project that uses it. In the plugin folder, run the following command:

npm link

In the other project folder, run the following command:

npm link <plugin-name>

To publish the plugin to npm, make sure you are logged in to npm. Run the following command in your plugin folder:

npm publish

To manually build the plugin into the production mode, run the following command:

npm run build

Summary

This article introduces an easy-to-use vue-cli template for publishing Vue components. The template comes with webpack 2.0 pre-configured and supports import and browser installation. It also supports popular CSS preprocessors like Less, Sass/Scss, and Stylus. The article provides installation instructions, guides on watching and compiling the components, using the template in another project, and publishing the plugin to npm. Overall, this template simplifies the process of publishing and developing Vue components.