mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-06 15:30:27 +03:00
Fix vite build to place element-call correctly for embedded npm package support
This commit is contained in:
parent
4c8ab4e79d
commit
d3ec9facf6
1 changed files with 9 additions and 6 deletions
|
|
@ -14,9 +14,9 @@ import buildConfig from './build.config';
|
|||
const copyFiles = {
|
||||
targets: [
|
||||
{
|
||||
src: 'node_modules/@element-hq/element-call-embedded/dist',
|
||||
dest: 'element-call'
|
||||
},
|
||||
src: 'node_modules/@element-hq/element-call-embedded/dist/*',
|
||||
dest: 'public/element-call',
|
||||
},
|
||||
{
|
||||
src: 'node_modules/pdfjs-dist/build/pdf.worker.min.mjs',
|
||||
dest: '',
|
||||
|
|
@ -51,7 +51,10 @@ function serverMatrixSdkCryptoWasm(wasmFilePath) {
|
|||
configureServer(server) {
|
||||
server.middlewares.use((req, res, next) => {
|
||||
if (req.url === wasmFilePath) {
|
||||
const resolvedPath = path.join(path.resolve(), "/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm");
|
||||
const resolvedPath = path.join(
|
||||
path.resolve(),
|
||||
'/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm'
|
||||
);
|
||||
|
||||
if (fs.existsSync(resolvedPath)) {
|
||||
res.setHeader('Content-Type', 'application/wasm');
|
||||
|
|
@ -106,8 +109,8 @@ export default defineConfig({
|
|||
},
|
||||
devOptions: {
|
||||
enabled: true,
|
||||
type: 'module'
|
||||
}
|
||||
type: 'module',
|
||||
},
|
||||
}),
|
||||
],
|
||||
optimizeDeps: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue