Skip to content

Commit

Permalink
fix: configure vite to copy wasm file required
Browse files Browse the repository at this point in the history
  • Loading branch information
raimund-schluessler committed Dec 27, 2023
1 parent 7a26d29 commit 8714bc7
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 12 deletions.
67 changes: 56 additions & 11 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
"jest-environment-jsdom": "29.7.0",
"jest-serializer-vue": "3.1.0",
"jest-transform-stub": "^2.0.0",
"regenerator-runtime": "0.14.1"
"regenerator-runtime": "0.14.1",
"vite-plugin-static-copy": "^1.0.0"
},
"engines": {
"node": ">=15.0.0",
Expand Down
17 changes: 17 additions & 0 deletions vite.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
import { createAppConfig } from '@nextcloud/vite-config'
import { defineConfig } from 'vite'
import { viteStaticCopy } from 'vite-plugin-static-copy'

const config = defineConfig({
plugins: [
viteStaticCopy({
targets: [
{
src: 'js/zxing_reader.wasm',
dest: 'node_modules/@sec-ant/zxing-wasm/dist/reader/zxing_reader.wasm'
}
]
})
]
})

export default createAppConfig({
main: 'src/main.js',
}, {
config
})

0 comments on commit 8714bc7

Please sign in to comment.