mirror of
https://github.com/laravel/laravel.git
synced 2025-02-20 11:53:14 +08:00
Switch to ESM imports (#5895)
This improves the transition for Vite users.
This commit is contained in:
parent
8d3a964edc
commit
2e3563d9aa
@ -1 +1 @@
|
||||
require('./bootstrap');
|
||||
import './bootstrap';
|
||||
|
9
resources/js/bootstrap.js
vendored
9
resources/js/bootstrap.js
vendored
@ -1,4 +1,5 @@
|
||||
window._ = require('lodash');
|
||||
import _ from 'lodash';
|
||||
window._ = _;
|
||||
|
||||
/**
|
||||
* We'll load the axios HTTP library which allows us to easily issue requests
|
||||
@ -6,7 +7,8 @@ window._ = require('lodash');
|
||||
* CSRF token as a header based on the value of the "XSRF" token cookie.
|
||||
*/
|
||||
|
||||
window.axios = require('axios');
|
||||
import axios from 'axios';
|
||||
window.axios = axios;
|
||||
|
||||
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||
|
||||
@ -18,7 +20,8 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||
|
||||
// import Echo from 'laravel-echo';
|
||||
|
||||
// window.Pusher = require('pusher-js');
|
||||
// import Pusher from 'pusher-js';
|
||||
// window.Pusher = Pusher;
|
||||
|
||||
// window.Echo = new Echo({
|
||||
// broadcaster: 'pusher',
|
||||
|
Loading…
x
Reference in New Issue
Block a user