From f02e022aa169f6e4b172e5c03e47a6690776318a Mon Sep 17 00:00:00 2001 From: codetheorem Date: Tue, 7 Jul 2020 18:47:46 +0530 Subject: [PATCH] npm --- .gitignore | 1 + package.json | 15 +++++++++------ src/components/index.js | 25 ++++++------------------- src/components/loader.vue | 1 + vue.config.js | 16 +++++++--------- 5 files changed, 24 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index 7df6d18..11f5d71 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_Store node_modules +/dist # local env files .env.local diff --git a/package.json b/package.json index 748242b..ea79b8c 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { - "name": "vue-ui-loader", - "version": "1.0.0", + "name": "vue-ui-preloader", + "version": "1.0.10", "private": false, "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", "lint": "vue-cli-service lint", - "build-bundle": "vue-cli-service build --target lib --name vue-ui-loader ./src/components/index.js" + "build-bundle": "vue-cli-service build --target lib --name loader ./src/components/loader.vue" }, "dependencies": { "bootstrap": "^4.5.0", @@ -34,7 +34,8 @@ "eslint-plugin-vue": "^6.2.2", "vue-template-compiler": "^2.6.11" }, - "main": "./dist/vue-ui-loader.common.js", + "main": "./src/components/index.js", + "unpkg": "dist/loader.umd.min.js", "license": "MIT", "eslintConfig": { "root": true, @@ -56,7 +57,9 @@ "not dead" ], "files": [ - "dist/vue-ui-loader.common.js", - "dist/vue-ui-loader.umd.js" + "dist/*", + "src/*", + "*.json", + "*.js" ] } diff --git a/src/components/index.js b/src/components/index.js index 758fda4..bb6b32e 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -1,28 +1,15 @@ // Import vue component -import {Uiloader} from './loader.vue'; +import loader from './loader.vue'; // Declare install function executed by Vue.use() -export function install(Vue) { - if (install.installed) return; - install.installed = true; - Vue.component('loader',Uiloader); +const install = (Vue) => { + Vue.component('loader', loader) } -// Create module definition for Vue.use() -const plugin = { - install, -}; -// Auto-install when vue is found (eg. in browser via