npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

components-personal-data

v0.2.15

Published

``` Configuración para la generación de un modulo npm con vue 3

Downloads

12

Readme

input-vue3-components

Configuración para la generación de un modulo npm con vue 3 

Favor de leer primero y luego ejecutar las instrucciones

Instalar la siguiente paquetería a nustro proyecto para generar los modulos 

https://www.npmjs.com/package/rollup
npm i rollup

https://www.npmjs.com/package/@rollup/plugin-buble
npm i @rollup/plugin-buble

https://www.npmjs.com/package/rollup-plugin-vue
npm i rollup-plugin-vue

https://www.npmjs.com/package/vue-template-compiler
npm i vue-template-compiler

cada uno de estos paquetes instalarlo con la terminación –save-dev para que se instalen el modo de desarrollo 
ejemplo 

npm i vue-template-compiler –save-dev


paso 2 

En nuestro package.json agregaremos las lineas donde estos modulos aran una referencia a donde nuestro coponete realizara su exportacion que en este caso seria la carpeta dist/ y el nombre de nuestro componete junto con la extencion, tambien de donde probiene el componente que exportaremos

"main": "dist/my-component.umd.js",
  "module": "dist/my-component.esm.js",
  "unpkg": "dist/my-component.min.js",
  "browser": {
    "./sfc": "src/my-component.vue"
  },





Paso 2.1

"name": "input-vue3-components",
"version": "0.1.0",

En esta seccion Podemos versionar nuestra paqueteria y realizar sus distintas versiones.

Paso 3 
Seguido agregaremos estas lineas en el mismo archivo  donde este sera en cargado de exportar el modulo de la paqueteria.
"scripts": {
    "build": "npm run build:umd & npm run build:es & npm run build:unpkg",
    "build:umd": "rollup --config rollup.config.js --format umd --file dist/my-component.umd.js",
    "build:es": "rollup --config rollup.config.js --format es --file dist/my-component.esm.js",
    "build:unpkg": "rollup --config rollup.config.js --format iife --file dist/my-component.min.js"
  },

Paso 4 
Crearemos un archivo llamado rollup.config.js, en este archivo agregaremos lo siguiente y Podemos crearlo a nivel de rais del Proyecto.

import vue from 'rollup-plugin-vue'; // Handle .vue SFC files
import buble from 'rollup-plugin-buble'; // Transpile/polyfill with reasonable browser support
export default {
    input: 'src/index.js', // Path relative to package.json
    output: {
        name: “Nombre de nuestro componente”,
        exports: 'named',
    },
    plugins: [
        vue({
            css: true, // Dynamically inject css as a <style> tag
            compileTemplate: true, // Explicitly convert template to render function
        }),
        buble(), // Transpile to ES5
    ],
};

Paso 5 
Por ultimo en la capeta src crearemos un archivo js llamado index.js donde agregaremos las siguientes líneas del código 

// Import vue component
import component from './'’Agregamos la ruta del componete a exportar’ ';

// Declare install function executed by Vue.use()
export function install(Vue) {
	if (install.installed) return;
	install.installed = true;
	Vue.component('InputReactiveFormSimple', component);
}

// Create module definition for Vue.use()
const plugin = {
	install,
};

// Auto-install when vue is found (eg. in browser via <script> tag)
let GlobalVue = null;
if (typeof window !== 'undefined') {
	GlobalVue = window.Vue;
} else if (typeof global !== 'undefined') {
	GlobalVue = global.Vue;
}
if (GlobalVue) {
	GlobalVue.use(plugin);
}

// To allow use as module (npm/webpack/etc.) export component
export default component;