Socket
Book a DemoInstallSign in
Socket

@arijs/vite-plugin-vue-mfc

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arijs/vite-plugin-vue-mfc

Note: requires `@vitejs/plugin-vue` as loader for your components.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

@arijs/vite-plugin-vue-mfc npm

Note: requires @vitejs/plugin-vue as loader for your components.

This plugin is meant to create a virtual file which binds together each 'block' of your component.

Instead of this:

<!-- HelloWorld.vue -->
<template>
    <!-- your html here -->
</template>
<script>
    // your script here
</script>
<style>
    /* your styles here */
</style>

You can have this:

+ components/
|--+ HelloWorld/
|  |--+ SubComp/
|  |  |--- SubComp.css
|  |  |--- SubComp.html
|  |  `--- SubComp.js
|  |--- HelloWorld.css
|  |--- HelloWorld.html
|  `--- HelloWorld.js
/* HelloWorld.css */
.hello-world {}
<!-- HelloWorld.html -->
<div class="hello-world">
	<!-- ... -->
</div>
// HelloWorld.js
//
// Paths are relative from where the folder is contained, not the files
// In this case, it's relative from 'components/', not from 'HelloWorld/'
// Think of the folder as a virtual 'HelloWorld.vue' file
import SubComp from "./HelloWorld/SubComp.vue";
import { defineComponent } from "vue";

export default defineComponent({
	name: 'HelloWorld',
	components: {
		SubComp,
	},
	// ...
});

How to use

// vite.config.js
import vueMfc from '@arijs/vite-plugin-vue-mfc'
import vue from '@vitejs/plugin-vue'

export default {
  plugins: [vueMfc(), vue()]
}

License

MIT.

FAQs

Package last updated on 29 May 2021

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