Socket
Socket
Sign inDemoInstall

@vitejs/plugin-vue2

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitejs/plugin-vue2


Version published
Weekly downloads
214K
decreased by-7.98%
Maintainers
4
Weekly downloads
 
Created

What is @vitejs/plugin-vue2?

@vitejs/plugin-vue2 is a Vite plugin that provides support for Vue 2.x single-file components (SFCs). It allows developers to leverage the fast and modern build tool Vite while working with Vue 2 projects.

What are @vitejs/plugin-vue2's main functionalities?

Vue 2 Single File Component Support

This feature allows you to use Vue 2 single-file components (SFCs) in your Vite project. The code sample demonstrates a basic setup where a Vue 2 component is imported and mounted to a DOM element.

import { createApp } from 'vue';
import App from './App.vue';

createApp(App).mount('#app');

Hot Module Replacement (HMR)

This feature enables Hot Module Replacement (HMR) for Vue 2 components, allowing for instant updates without a full page reload. The code sample shows how to set up HMR in a Vue 2 project using Vite.

import { createApp } from 'vue';
import App from './App.vue';

if (import.meta.hot) {
  import.meta.hot.accept();
}

createApp(App).mount('#app');

Custom Block Support

This feature allows the use of custom blocks in Vue 2 single-file components. The code sample demonstrates a Vue 2 SFC with a custom block.

<template>
  <div>{{ msg }}</div>
</template>

<script>
export default {
  data() {
    return {
      msg: 'Hello World'
    };
  }
};
</script>

<style scoped>
div {
  color: red;
}
</style>

<custom-block>
  This is a custom block
</custom-block>

Other packages similar to @vitejs/plugin-vue2

FAQs

Package last updated on 20 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc