Skip to content

Commit 390ba2b

Browse files
committed
Fix error default is not exported
1 parent fdc1f0c commit 390ba2b

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

dist/vue-clock.js renamed to dist/vue-clock.umd.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
var VueClock = (function () {
2-
'use strict';
1+
(function (global, factory) {
2+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3+
typeof define === 'function' && define.amd ? define(factory) :
4+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.VueClock = factory());
5+
}(this, (function () { 'use strict';
36

47
const SECOND = 1000;
58
const HOUR = 12;
@@ -237,4 +240,4 @@ var VueClock = (function () {
237240

238241
return __vue_component__;
239242

240-
}());
243+
})));

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "@dangvanthanh/vue-clock",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"description": "Simple clock using Vue.js",
55
"author": "Dang Van Thanh <[email protected]>",
66
"main": "dist/vue-clock.cjs.js",
77
"module": "dist/vue-clock.esm.js",
8-
"browser": "dist/vue-clock.js",
8+
"browser": "dist/vue-clock.umd.js",
99
"scripts": {
1010
"build": "rollup -c"
1111
},

rollup.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default [
1414
{
1515
input: 'src/index.js',
1616
output: {
17+
exports: 'default',
1718
format: 'cjs',
1819
file: 'dist/vue-clock.cjs.js',
1920
},
@@ -23,8 +24,8 @@ export default [
2324
input: 'src/index.js',
2425
output: {
2526
name: 'VueClock',
26-
format: 'iife',
27-
file: 'dist/vue-clock.js',
27+
format: 'umd',
28+
file: 'dist/vue-clock.umd.js',
2829
},
2930
plugins: [vue(), resolve(), commonjs()],
3031
},

0 commit comments

Comments
 (0)