Skip to content

Commit

Permalink
npm
Browse files Browse the repository at this point in the history
  • Loading branch information
codetheorem committed Jul 7, 2020
1 parent 17a027a commit f02e022
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 34 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
node_modules
/dist

# local env files
.env.local
Expand Down
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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,
Expand All @@ -56,7 +57,9 @@
"not dead"
],
"files": [
"dist/vue-ui-loader.common.js",
"dist/vue-ui-loader.umd.js"
"dist/*",
"src/*",
"*.json",
"*.js"
]
}
25 changes: 6 additions & 19 deletions src/components/index.js
Original file line number Diff line number Diff line change
@@ -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 <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);
export default {
install
}

// To allow use as module (npm/webpack/etc.) export component
export default {Uiloader};
export {loader};
1 change: 1 addition & 0 deletions src/components/loader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import circular from "./loaders/circular";
import toptombar from "./loaders/toptombar";
import box from "./loaders/box";
export default {
name: 'loader',
components:{
spinning: loader1,
dots: dots,
Expand Down
16 changes: 7 additions & 9 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
module.exports = {
css: {
extract: false
},
configureWebpack: {
output: {
libraryExport: 'default'
}
}
}
publicPath: '/vue-ui-preloader/',
configureWebpack: {
output: {
libraryExport: 'default'
}
}
}

0 comments on commit f02e022

Please sign in to comment.