Template
Fix browser WebSocket bundle
This commit is contained in:
@@ -1,8 +1,16 @@
|
|||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
import vue from '@vitejs/plugin-vue';
|
import vue from '@vitejs/plugin-vue';
|
||||||
|
import { resolve } from 'node:path';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [vue()],
|
plugins: [vue()],
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
// stompjs' package entry also imports its Node.js transport. Use the
|
||||||
|
// browser-only build so Vite does not emit a bare "websocket" import.
|
||||||
|
stompjs: resolve(__dirname, 'node_modules/stompjs/lib/stomp.js'),
|
||||||
|
},
|
||||||
|
},
|
||||||
define: {
|
define: {
|
||||||
global: 'globalThis',
|
global: 'globalThis',
|
||||||
},
|
},
|
||||||
@@ -21,4 +29,3 @@ export default defineConfig({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user