Skip to content

Commit

Permalink
chore(build): use vite for umd script naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Sec-ant authored and gruhn committed Oct 24, 2023
1 parent 39b28b1 commit 71aa67d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 76 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"packageManager": "[email protected]",
"type": "module",
"scripts": {
"build": "pnpm rimraf dist && vite build && cp dist/vue-qrcode-reader.umd.cjs dist/vue-qrcode-reader.umd.js",
"build": "vite build",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs",
Expand Down Expand Up @@ -55,7 +55,6 @@
"husky": "8.0.3",
"lint-staged": "15.0.2",
"prettier": "3.0.3",
"rimraf": "5.0.5",
"semantic-release": "22.0.5",
"typescript": "5.2.2",
"vite": "4.5.0",
Expand Down
72 changes: 0 additions & 72 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ export default defineConfig({
// others are defaults from emscripten and vite
target: ['es2020', 'edge88', 'firefox68', 'chrome75', 'safari13'],
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'VueQrcodeReader'
entry: {
'vue-qrcode-reader': resolve(__dirname, 'src/index.ts')
},
formats: ['es', 'umd'],
name: 'VueQrcodeReader',
fileName: (format, entryName) =>
format === 'es' ? `${entryName}.js` : `${entryName}.${format}.js`
},
rollupOptions: {
external: ['vue'],
Expand Down

0 comments on commit 71aa67d

Please sign in to comment.