Skip to content

Commit

Permalink
fix(build): update extension for es format
Browse files Browse the repository at this point in the history
  • Loading branch information
phucpham095 committed Jan 11, 2024
1 parent a009a37 commit e73cc98
Show file tree
Hide file tree
Showing 3 changed files with 278 additions and 21 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"serve": "vite preview"
},
"main": "lib/vue-next-progressbar.cjs.js",
"browser": "lib/vue-next-progressbar.es.js",
"module": "lib/vue-next-progressbar.es.js",
"browser": "lib/vue-next-progressbar.es.mjs",
"module": "lib/vue-next-progressbar.es.mjs",
"unpkg": "lib/vue-next-progressbar.umd.js",
"style": "lib/vue-next-progressbar.min.css",
"files": [
Expand All @@ -57,7 +57,7 @@
"prettier": "^2.3.2",
"sass": "^1.35.1",
"semver": "^7.3.5",
"vite": "^2.3.8",
"vite": "^5.0.11",
"vue": "^3.1.4",
"vue-router": "^4.0.10"
},
Expand Down
5 changes: 5 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ export default ({ command, mode }) => {
entry: path.resolve(__dirname, 'src/progressbar.js'),
name: 'VueNextProgressbar',
formats: ['es', 'cjs', 'umd'],
fileName: (format) => {
const name = `vue-next-progressbar.${format}`;
const extension = format === 'es' ? 'mjs' : 'js';
return `${name}.${extension}`;
},
},
};
}
Expand Down
Loading

0 comments on commit e73cc98

Please sign in to comment.