1- // window._ = require('lodash') ;
1+ import 'bootstrap' ;
22
33/**
4- * We'll load jQuery and the Bootstrap jQuery plugin which provides support
5- * for JavaScript based Bootstrap features such as modals and tabs. This
6- * code may be modified to fit the specific needs of your application .
4+ * We'll load the axios HTTP library which allows us to easily issue requests
5+ * to our Laravel back-end. This library automatically handles sending the
6+ * CSRF token as a header based on the value of the "XSRF" token cookie .
77 */
88
9- try {
10- window . Popper = require ( 'popper.js' ) . default ;
11- window . $ = window . jQuery = require ( 'jquery' ) ;
9+ import axios from 'axios' ;
10+ window . axios = axios ;
1211
13- require ( 'bootstrap' ) ;
14- } catch ( e ) {
15- }
12+ window . axios . defaults . headers . common [ 'X-Requested-With' ] = 'XMLHttpRequest' ;
1613
1714/**
1815 * Echo exposes an expressive API for subscribing to channels and listening
@@ -22,11 +19,15 @@ try {
2219
2320// import Echo from 'laravel-echo';
2421
25- // window.Pusher = require('pusher-js');
22+ // import Pusher from 'pusher-js';
23+ // window.Pusher = Pusher;
2624
2725// window.Echo = new Echo({
2826// broadcaster: 'pusher',
29- // key: process.env.MIX_PUSHER_APP_KEY,
30- // cluster: process.env.MIX_PUSHER_APP_CLUSTER,
31- // encrypted: true
27+ // key: import.meta.env.VITE_PUSHER_APP_KEY,
28+ // wsHost: import.meta.env.VITE_PUSHER_HOST ?? `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
29+ // wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
30+ // wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
31+ // forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
32+ // enabledTransports: ['ws', 'wss'],
3233// });
0 commit comments