Skip to content

Commit 6c658cd

Browse files
authored
Merge pull request #32 from codetheorem/master
npm
2 parents aac01a1 + f02e022 commit 6c658cd

File tree

5 files changed

+24
-34
lines changed

5 files changed

+24
-34
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.DS_Store
22
node_modules
3+
/dist
34

45
# local env files
56
.env.local

package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "vue-ui-loader",
3-
"version": "1.0.0",
2+
"name": "vue-ui-preloader",
3+
"version": "1.0.10",
44
"private": false,
55
"scripts": {
66
"serve": "vue-cli-service serve",
77
"build": "vue-cli-service build",
88
"lint": "vue-cli-service lint",
9-
"build-bundle": "vue-cli-service build --target lib --name vue-ui-loader ./src/components/index.js"
9+
"build-bundle": "vue-cli-service build --target lib --name loader ./src/components/loader.vue"
1010
},
1111
"dependencies": {
1212
"bootstrap": "^4.5.0",
@@ -34,7 +34,8 @@
3434
"eslint-plugin-vue": "^6.2.2",
3535
"vue-template-compiler": "^2.6.11"
3636
},
37-
"main": "./dist/vue-ui-loader.common.js",
37+
"main": "./src/components/index.js",
38+
"unpkg": "dist/loader.umd.min.js",
3839
"license": "MIT",
3940
"eslintConfig": {
4041
"root": true,
@@ -56,7 +57,9 @@
5657
"not dead"
5758
],
5859
"files": [
59-
"dist/vue-ui-loader.common.js",
60-
"dist/vue-ui-loader.umd.js"
60+
"dist/*",
61+
"src/*",
62+
"*.json",
63+
"*.js"
6164
]
6265
}

src/components/index.js

+6-19
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,15 @@
11
// Import vue component
2-
import {Uiloader} from './loader.vue';
2+
import loader from './loader.vue';
33

44
// Declare install function executed by Vue.use()
5-
export function install(Vue) {
6-
if (install.installed) return;
7-
install.installed = true;
8-
Vue.component('loader',Uiloader);
5+
const install = (Vue) => {
6+
Vue.component('loader', loader)
97
}
108

11-
// Create module definition for Vue.use()
12-
const plugin = {
13-
install,
14-
};
159

16-
// Auto-install when vue is found (eg. in browser via <script> tag)
17-
let GlobalVue = null;
18-
if (typeof window !== 'undefined') {
19-
GlobalVue = window.Vue;
20-
} else if (typeof global !== 'undefined') {
21-
GlobalVue = global.Vue;
22-
}
23-
if (GlobalVue) {
24-
GlobalVue.use(plugin);
10+
export default {
11+
install
2512
}
2613

2714
// To allow use as module (npm/webpack/etc.) export component
28-
export default {Uiloader};
15+
export {loader};

src/components/loader.vue

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import circular from "./loaders/circular";
1919
import toptombar from "./loaders/toptombar";
2020
import box from "./loaders/box";
2121
export default {
22+
name: 'loader',
2223
components:{
2324
spinning: loader1,
2425
dots: dots,

vue.config.js

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
module.exports = {
2-
css: {
3-
extract: false
4-
},
5-
configureWebpack: {
6-
output: {
7-
libraryExport: 'default'
8-
}
9-
}
10-
}
2+
publicPath: '/vue-ui-preloader/',
3+
configureWebpack: {
4+
output: {
5+
libraryExport: 'default'
6+
}
7+
}
8+
}

0 commit comments

Comments
 (0)