
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
vite-plugin-components
Advanced tools
On demand components auto importing for Vite
Install
npm i vite-plugin-components -D # yarn add vite-plugin-components -D
Add it to vite.config.js
// vite.config.js
import ViteComponents from 'vite-plugin-components'
export default {
plugins: [
ViteComponents()
]
}
That's all.
Use components in templates as you would usually do but NO import
and component registration
required anymore! It will import components on demand, code spliting is also possible.
Basically, it automatically turns this
<template>
<div>
<HelloWorld msg="Hello Vue 3.0 + Vite" />
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
into this
<template>
<div>
<HelloWorld msg="Hello Vue 3.0 + Vite" />
</div>
</template>
<script>
import HelloWorld from './src/components/HelloWorld.vue'
export default {
name: 'App',
components: {
HelloWorld
}
}
</script>
The following show the default values of the configuration
ViteComponents({
// Relative paths to the directory to search for components.
dirs: ['src/components'],
// Valid file extensions for components.
extensions: ['vue'],
// Search for subdirectories
deep: true,
})
See the Vitesse starter template.
Thanks to @brattonross, this project is heavily inspired by vite-plugin-voie.
MIT License © 2020 Anthony Fu
FAQs
Components auto importing for Vite
The npm package vite-plugin-components receives a total of 1,228 weekly downloads. As such, vite-plugin-components popularity was classified as popular.
We found that vite-plugin-components demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.