🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@vitejs/plugin-vue2

Package Overview
Dependencies
Maintainers
6
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitejs/plugin-vue2

> [!CAUTION] > Vue 2 has reached EOL, and this project is no longer actively maintained.

2.3.3
latest
Source
npm
Version published
Weekly downloads
284K
-10.06%
Maintainers
6
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 26 Nov 2024

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